#include<cstdio>
bool isrun(int s){
	if (s % 400 == 0 || s % 100 != 0 && s % 4 == 0){
		return true;
	}
	else{
		return false;
	}
}
int cal(int year){
	int m, n;
	m = year / 4;
	n = year % 4;
	return n * 365 + m*(365 + 365 + 366 + 365);
}
int totalday(int n){
	int year, mon, day;
	year = n / 10000;
	day = n % 100;
	mon = (n % 10000) / 100;
	int k[13];
	k[0] = 0;
	int mday[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	for (int i = 1; i<13; i++){
		k[i] = k[i - 1] + mday[i - 1];
	}
	if (isrun(year) == true && mon > 2){
		return cal(year) + k[mon] + day + 1;
	}
	else{
		return cal(year) + k[mon] + day;
	}
}
int main(){
	int d1,d2;
	while (scanf("%d %d", &d1, &d2) != EOF){
		int gap=totalday(d2)-totalday(d1);
		printf("%d\n", gap+1);
	}
}