#include <bits/stdc++.h> using namespace std; const int months[]={ 0,31,28,31,30,31,30,31,31,30,31,30,31 }; int is_leap(int year){ if (year%4==0 && year%100!=0 || year%400 == 0) return 1; return 0; } int get_days(int year, int month){ int res = months[month]; if (month == 2){ res += is_leap(year); } return res; } int get_days_year(int year){ if (is_leap(year)) return 366; return 365; } int main(){ string datee1, datee2; string year1, year2, month1, month2, day1, day2; int d1; int d2; int m1; int m2; int y1; int y2; while (cin >> datee1 >> datee2){ if (datee1 > datee2){ swap(datee1, datee2); } year1 = datee1.substr(0,4); year2 = datee2.substr(0,4); month1 = datee1.substr(4,2); month2 = datee2.substr(4,2); day1 = datee1.substr(6,2); day2 = datee2.substr(6,2); y1 = stoi(year1); y2 = stoi(year2); m1 = stoi(month1); m2 = stoi(month2); d1 = stoi(day1); d2 = stoi(day2); int res = 0; for (int i=1; i<=m2-1; i++){ res += get_days(y2,i); } res += d2; for (int i=y1; i<=y2-1; i++){ res += get_days_year(i); } for (int i=1; i<=m1-1; i++){ res = res - get_days(y1, i); } res = res - d1; printf("%d\n", res+1); } return 0; }