#include <iostream>
using namespace std;
int mon[2000]={0,31,28,31,30,31,30,31,31,30,31,30,31,0};
bool run(int year){
return year % 4 == 0 && year%100 != 0 || year % 400 == 0;
}
int main() {
int a, b;
while (cin >> a >> b) { // 注意 while 处理多个 case
int res = 1,d=a%100,m=a/100%100,y=a/10000;
int d1=b%100,m1=b/100%100,y1=b/10000;
// cout<<y<<" "<<m<<" "<<d;
while(d!=d1 || m!=m1 || y!=y1){
if(!run(y))mon[y] = 28;
else mon[2] = 29;
res++;
d++;
if(d>mon[m]){
m++;
if(m==13){
y++;
m = 1;
if(!run(y))mon[y] = 28;
else mon[2] = 29;
}
d=1;
}
// cout<<y<<" "<<m<<" "<<d<<"--"<<res<<endl;
} cout<<res<<endl;
}
}
// 64 位输出请用 printf("%lld")