#include <iostream>
#include <stack>
#include <string>
#include<queue>
#include<vector>
using namespace std;
bool is_runnian(int year) {
	return (year % 400 == 0) || year % 4 == 0 && year % 100 != 0;

}
 int monthday[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 } };
int dayOFyear(int year, int month, int day) {
	int leap = is_runnian(year) ? 1 : 0;
	int day_year = 0;
	for(int i = 1; i < month; i++) {
		day_year += monthday[leap][i];

	}
	return day_year + day;
}
void cout_year_month_day(int year, int daysum) {
	
	int leap = is_runnian(year) ? 1 : 0;
	while (daysum >=(365 + leap))
	{
		daysum =daysum - (365 + leap);
		year++;
		leap = is_runnian(year) ? 1 : 0;
	}int day_result=0;
	int day_total=0;
	int month_result = 0;
	leap = is_runnian(year) ? 1 : 0;
	for (int i = 1; i < 13; i++) 
	{
		day_result = daysum - day_total;
		day_total += monthday[leap][i];
		if (daysum <= day_total) {
			month_result = i;
			break;
		}
	}
	printf("%04d-%02d-%02d\n", year, month_result, day_result);

}
int abs(int a, int b) {
	return a > b ? a - b : b - a;
}
//int main()
//{
//	/*int L, M;
//	while (cin >> L >> M) {
//		std::vector<int> tree(L+1);
//		std::vector<std::vector<int>> emptytree( 2,std::vector<int>(M));
//		for (int i = 0; i <= L; i++) {
//			tree[i] = 1;
//		}
//		for (int i = 0; i < M; i++) {
//			
//		}*/
//
//	}
//}
void nextday(int& year, int& month, int& day)
{
	bool leap = is_runnian(year);
	if (day == monthday[leap][month])
	{
		day = 1;
		month++;
		if (month == 13) {
			month = 1;
			year++;
		}
	}
	else {
		day++;
	}
}
int main() {
	int time, time2;
	while (cin >> time >> time2) {
		int sum = 1;
		bool big2 = time < time2;
		int day = time % 100;
		int month = time / 100 % 100;
		int year = time / 10000 % 10000;
		int day2 = time2 % 100;
		int month2 = time2 / 100 % 100;
		int year2 = time2 / 10000 % 10000;
		if (big2) {
			while (1) {
				if (year == year2 && month == month2 && day == day2)
				{
					break;
				}
				nextday(year, month, day);
				++sum;
			}
		}
		else {
			
			while (1) {
				if (year2 == year && month2 == month && day2 == day)
				{
					break;
				}
				nextday(year2, month2, day2);
				++sum;
			}
		}


		cout << sum;
	}


}