#include <iostream>
using namespace std;
int main()
{
int year1,month1,day1;
int year2,month2,day2;
while(cin>>year1>>month1>>day1>>year2>>month2>>day2)
{
if(year1>year2)
swap(year1,year2),swap(month1,month2),swap(day1,day2);
else if(month1>month2)
swap(year1,year2),swap(month1,month2),swap(day1,day2);
else if(day1>day2)
swap(year1,year2),swap(month1,month2),swap(day1,day2);
int away=0;
month2--;
while(!(year1==year2&&month1>month2))
{
if(month2==0)
year2--,month2=12;
int tp=0;
if(month2==2)
tp=(year2%4==0&&year2%100!=0||year2%400==0)?29:28;
else if(month2<=7)
tp=(month2%2==0)?30:31;
else if(month2>=8)
tp=(month2%2==0)?31:30;
month2--;
away+=tp;
}
away-=day1;
away+=day2;
cout<<away<<endl;
}
}