#include <iostream>
using namespace std;
int num1[12] = { 31,29,31,30,31,30,31,31,30,31,30,31 };
int num2[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
int isyear(int year) { //计算某年是否是闰年,返回不同天数
if ((year % 100 != 0 && year % 4 == 0) || year % 400 == 0) {
return 366;
}
else return 365;
}
int frontday(int year, int month, int day) { //计算这年过了多少天了
int sum = 0;
if (isyear(year)==366 ) {
for (int i = 0; i < month - 1; i++) {
sum += num1[i];
}
return sum + day;
}
else {
for (int i = 0; i < month - 1; i++) {
sum += num2[i];
}
return sum + day;
}
}
int backday(int year, int month, int day) { //计算这年还剩多少天
return isyear(year) - frontday( year, month, day);
}
int JudgeMonthDay(int year, int month1, int month2, int day1, int day2) { //计算几个月之间的天数,这个思路同计算不同年之间的天数
int sum = 0;
if ((year % 100 != 0 && year % 4 == 0) || year % 400 == 0) {
if (month1 == month2) return day2 - day1;
if ((month2 - month1) == 1) {
return (num1[month1 - 1] - day1 + day2);
}
if ((month2 - month1) > 1) {
sum = num1[month1 - 1] - day1 + day2;
for (int i = month1 + 1; i <= month2 - 1; i++) {
sum += num1[i - 1];
}
return sum;
}
}
else {
if (month1 == month2) return day2 - day1;
if ((month2 - month1) == 1) {
return num2[month1 - 1] - day1 + day2;
}
if ((month2 - month1) > 1) {
sum = num2[month1 - 1] - day1 + day2;
for (int i = month1 + 1; i <= month2 - 1; i++) {
sum += num2[i - 1];
}
return sum;
}
}
}
int Judge(long year1, long month1, long day1, long year2, long month2, long day2) {
//long month1 = (Date1 % 10000 - day1) / 100;
//long year1 = (Date1 - Date1 % 10000) / 10000;
//long day2 = Date2 % 100;
//long month2 = (Date2 % 10000 - day2) / 100;
//long year2= (Date2 - Date2 % 10000) / 10000;
int sum = 0;
if ((year2 - year1) == 0) {
sum = JudgeMonthDay(year1, month1, month2, day1, day2);
}
if ((year2 - year1) == 1) sum = backday(year1, month1, day1) + frontday(year2, month2, day2);
if ((year2 - year1) > 1) {
sum = backday(year1, month1, day1) + frontday(year2, month2, day2);
for (int i = year1 + 1; i <= year2 - 1; i++) {
sum += isyear(i);
}
}
return sum;
}
int main() {
long year1, month1, day1;
long year2, month2, day2;
scanf_s("%ld", &year1);
scanf_s("%ld", &month1);
scanf_s("%ld", &day1);
scanf_s("%ld", &year2);
scanf_s("%ld", &month2);
scanf_s("%ld", &day2);
int n = Judge(year1, month1, day1, year2, month2, day2);
printf("%d", n);
return 0;
}