#include <iostream>
#include <math.h>
using namespace std;

int daytab[2][13] = {
{
	0,31,28,31,30,31,30,31,31,30,31,30,31	
},
{
	0,31,29,31,30,31,30,31,31,30,31,30,31
}
};

bool isLeapYear(int x){
	return (x % 4 ==0 && x % 100 != 0) || (x % 400 == 0);
}

int main(){
	int y1,m1,d1,y2,m2,d2;
	scanf("%04d%02d%02d",&y1,&m1,&d1);
	scanf("%04d%02d%02d",&y2,&m2,&d2);
	
	int sum1 = 0,sum2 = 0;
	for(int i = 0;i <= y1;i ++){
		if(isLeapYear(i)){
			sum1 += 366;
		}else 
		{
			sum1 += 365;
		}
	}
	
	for(int i = 0;i < m1;i ++){
		sum1 += daytab[isLeapYear(y1)][i];
	}
	sum1 += d1;
	
	for(int i = 0;i <= y2;i ++){
		if(isLeapYear(i)){
			sum2 += 366;
		}else sum2 += 365;
	}
	
	for(int i = 0;i < m2;i ++){
		sum2 += daytab[isLeapYear(y2)][i];
	}
	sum2 += d2;
	
	cout << abs(sum1 - sum2) + 1 << endl;
	
	
	
	return 0;
}