#include <iostream>
using namespace std;
bool check_year(int year){
    if((year%4==0&&year%100!=0)||year%400==0)return true;
    return false;
}

int main() {
    int date1,date2;
    int count[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}};

    while (cin >> date1 >> date2) { // 注意 while 处理多个 case
        if(date1>date2)swap(date1,date2);
        int year1,month1,day1;
        int year2,month2,day2;
        day1=date1%100;
        date1/=100;
        month1=date1%100;
        date1/=100;
        year1=date1;
        day2=date2%100;
        date2/=100;
        month2=date2%100;
        date2/=100;
        year2=date2;
        int res=0;
        //1,year1与year2同一年
        //2,year1与year2相差一年
        while(!(year1==year2&&month1==month2&&day1==day2)){
            day1++;
            res++;
            if(month1!=2){
                if(day1>count[0][month1]){
                    month1++;
                    day1=1;
                }
            }else{
                if(check_year(year1)){
                    if(day1>29){
                        month1++;
                        day1=1;
                    }
                }else{
                    if(day1>28){
                        month1++;
                        day1=1;
                    }
                }
            }
            if(month1>12){
                month1=1;
                year1++;
            }
        }
        cout<<res+1<<endl;
    }
}
// 64 位输出请用 printf("%lld"ΩΩ