#include<stdio.h>
int main()
{
long int sy,sm,sd,ey,em,ed,d;
long int a1,de1,de2,ds1,ds2,i,r,m,l=0;
int md[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
scanf("%d %d %d",&sy,&sm,&sd);
for(de1=ed,i=em-1;i>0;i--)
de1+=md[i];
for(ds1=sd,r=sm-1;r>0;r--)
ds1+=md[r];
for(m=sy+1;m<ey;m++)
{
if(m%4==0&&m%100!=0||m%400==0)
l+=1;
else ;
}
a1=(sy%4==0&&sy%100!=0||sy%400==0);
if (a1&&sm>2)
ds2=365-ds1;
else ds2=366-ds1;
if ((ey%4==0&&ey%100!=0||ey%400==0)&&em>2)
de2=de1+1;
else de2=de1;
if (sy==ey)
{
if (a1) d=ds2+de2-366-1;
else d=ds2+de2-365-1;
}
else d=ds2+de2-1+l*366+(ey-sy-1-l)*365;
printf("%ld",d);
}