int R(int year);
int main()
{
	int year1,month,day, total1,year,total2,tianshu,year2,month2,day2,i;
	scanf("%d%d%d",&year1,&month,&day);
	scanf("%d%d%d",&year2,&month2,&day2);
	total1=0;
	total2=0;
	for( i=1;i<month;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			total1+=31;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			total1+=30;
		}
		else if(i==2)
		{
			year=year1;
			if(R(year))
			{
				total1+=29;
			}
			else
			{
				total1+=28;
			}
		}
	}
	total1 +=day;
	for(year=1;year<year1;year++)
	{
		if(R(year))
		{
			total1+=366;
		}
		else
		{
			total1+=365;
		}
	}
	for(i=1;i<month2;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			total2+=31;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			total2+=30;
		}
		else if(i==2)
		{
			year=year2;
			if(R(year))
			{
				total2+=29;
			}
			else
			{
				total2+=28;
			}
		}
	}
	total2 +=day2;
	for(year=1;year<year2;year++)
	{
		if(R(year))
		{
			total2+=366;
		}
		else
		{
			total2+=365;
		}
	}
	tianshu=(total2-total1)>0?(total2-total1): (total1-total2);
	printf("%d",tianshu);
	return 0;
}
	int R( int year)
	{
		int result;
		if(year%400==0||(year%4)==0&&year%100!=0)
		{
			result=1;
		}
		else
		{
			result=0;
		}
		return result;
	}


int main()
{
	int starty,startm,startd;
	int endy,endm,endd;
	int days=0;
	int i;

	cin>>starty>>startm>>startd;
	cin>>endy>>endm>>endd;

	if(starty!=endy)
	{
	for(i=starty+1;i<endy;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))days=days+366;
		else days=days+365;
	}
	}

	if(!(starty==endy && startm==endm))

	{
		for(i=startm;i<=12;i++)
	{
		if(i==2)
		{
			if((starty%4==0 && starty% 100!=0) || (starty%400==0))days=days+29;
			else days=days+28;
		}
		else if(i==4 || i==6 || i==9 || i==11)days=days+30;
		else days=days+31;
	}
	for(i=1;i<endm;i++)
	{
		if(i==2)
		{
			if((endy%4==0 && endy% 100!=0) || (endy%400==0))days=days+29;
			else days=days+28;
		}
		else if(i==4 || i==6 || i==9 || i==11)days=days+30;
		else days=days+31;
	}

	}

	days=days-startd;
	days=days+endd;

	cout<<days;

	return 0;
}


int main()
{
	int sum=0,startYear ,startMonth,startDay,endYear,endMonth,endDay,i;
	cin>>startYear>>startMonth>>startDay>>endYear>>endMonth>>endDay;
	int runmonth[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int pinmonth[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	if (startYear==endYear)
	{
		if(startYear%4==0&&startYear%100!=0||startYear%400==0)
		{
			if(startMonth==endMonth)
				sum=sum+endDay-startDay;
			else
			{
				for(i=startMonth+1;i<endMonth;i++)
					sum=sum+runmonth[i-1];
				sum=runmonth[startMonth-1]-startDay+endDay;
			}
		}
		else
		{
			if(startMonth==endMonth)
				sum=sum+endDay-startDay;else
			{
				for(i=startMonth+1;i<endMonth;i++)
					sum=sum+pinmonth[i-1];
				sum=pinmonth[startMonth-1]-startDay+endDay;
			}

		}
	}
	else
	{
		for(i=startYear+1;i<endYear;i++)
		{
			if(i%4==0&&i%100!=0||i%400==0)
				sum=sum+366;
			else
				sum=sum+365;
		}
		if(startYear%4==0&&startYear%100!=0||startYear%400==0)
			//????????
		{
			for(i=startMonth+1;i<=12;i++)
				sum=sum+runmonth[i-1];
			sum=sum+runmonth[startMonth-1]-startDay;
		}
		else
		{
			for(i=startMonth+1;i<=12;i++)
				sum=sum+pinmonth[i-1];
			sum=sum+pinmonth[startMonth-1]-startDay;
		}
		if(endYear%4==0&&endYear%100!=0||endYear%400==0)
		{
			for(i=0;i<endMonth-1;i++)
			sum=sum+runmonth[i];
			sum=sum+endDay;
		}

		else
		{
			for(i=0;i<endMonth-1;i++)
				sum=sum+pinmonth[i];
			sum=sum+endDay;
		}
	}
	cout<<sum<<endl;
	return 0;
}


main()
{
	int runnian(int year);
	int tianshu(int moon, int yy);

	int y1,y2,m1,m2,d1,d2,days,i,j;
	scanf("%d %d %d",&y1,&m1,&d1);
	scanf("%d %d %d",&y2,&m2,&d2);
	days=0;
    for (i=y1;i<y2;i++)
	{
		if (runnian(i)==0) days=days+365;
		else
			days=days+366;
	}
	for (j=1;j<m1;j++)
		days=days-tianshu(j,y1);
	days=days-d1;
	for (j=1;j<m2;j++)
		days=days+tianshu(j,y2);
	days=days+d2;
	printf("%d\n",days);
}
int runnian(int year)
{
	int flag;
	flag=0;/*???*/
	if (year%4==0)
		if (year%100==0)
			if (year%400==0&&year%3200!=0)
				flag=1;
			else
			flag=0;
		else
		flag=1;
	else
	flag=0;
	return(flag);
}
int tianshu(int moon, int yy)
{
	int dd;
	dd=0;
	if ((moon==1)||(moon==3)||(moon==5)||(moon==7)||(moon==8)||(moon==10)||(moon==12)) dd=31;
	else
		if (moon==4||moon==6||moon==9||moon==11) dd=30;
		else
			if (runnian(yy)==1) dd=29;
			else
				dd=28;
	return (dd);
}


void main()
{
  int yone,monone,dayone;
  int ytwo,montwo,daytwo;
  scanf("%d%d%d",&yone,&monone,&dayone);
  scanf("%d%d%d",&ytwo,&montwo,&daytwo);
  int mon[12]={31,28,31,30,31,30,31,31,30,31,30,31};
  int i,j;
  int day=0;
  if(yone==ytwo)
  {
	  if(monone==montwo) day=daytwo-dayone;
	  else
	  {
		  if(yone%4==0&&yone%100!=0||yone%400==0) mon[1]=29;
		  for(i=monone;i<montwo;i++)
			  day=day+mon[i-1];
		  day=day+daytwo;
		  day=day-dayone;
	  }
	  mon[1]=28;
  }
  else
  {
	  if(yone%4==0&&yone%100!=0||yone%400==0) mon[1]=29;
	  for(i=monone;i<=12;i++) day=day+mon[i-1];
	  day=day-dayone;
	  mon[1]=28;
	  if(ytwo%4==0&&ytwo%100!=0||ytwo%400==0) mon[1]=29;
	  for(i=1;i<montwo;i++) day=day+mon[i-1];
	  day=day+daytwo;
	  mon[1]=28;
	  if(yone+1<ytwo)
	  {
		  for(j=yone+1;j<ytwo;j++)
		  {
			  day=day+365;
		      if(j%4==0&&j%100!=0||j%400==0) day=day+1;
		  }
	  }
  }
  printf("%d",day);
}


int main()
{
	int STARTyear,STARTmonth,STARTday,ENDyear,ENDmonth,ENDday;
	int i;
	int Pyear[12],Ryear[12];
	int STARTdate,ENDdate,date;
	int a[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	int b[12]={0,31,29,31,30,31,30,31,31,30,31,30};
	int disyear[402]={0,0};
	Pyear[0]=a[0];
	Ryear[0]=b[0];
	for( i=1 ; i<12 ; i++ )
	{
		Pyear[i]=Pyear[i-1]+a[i];
		Ryear[i]=Ryear[i-1]+b[i];
	}
	cin>>STARTyear>>STARTmonth>>STARTday
		>>ENDyear>>ENDmonth>>ENDday;
	if( (STARTyear % 4 == 0 && STARTyear % 100 != 0) || (STARTyear % 400 == 0) )
	{
		STARTdate=Ryear[STARTmonth-1]+STARTday-1;
	}
	else
	{
		STARTdate=Pyear[STARTmonth-1]+STARTday-1;
	}
	if( (ENDyear % 4 == 0 && ENDyear % 100 != 0) || (ENDyear % 400 == 0) )
	{
		ENDdate=Ryear[ENDmonth-1]+ENDday-1;
	}
	else
	{
		ENDdate=Pyear[ENDmonth-1]+ENDday-1;
	}
	for( i=1 ; i<401 ; i++ )
	{
		if( i%4!=0 || ( i%100==0 && i%400!=0 ) )
		{
			disyear[i+1]=disyear[i]+365;
		}
		else
		{
			disyear[i+1]=disyear[i]+366;
		}
	}

	for( i=1 ; i<401 ; i++ )
	{
		if( STARTyear%400==i%400 )
		{
			STARTdate+=disyear[401]*( (STARTyear-i)/400 )+disyear[i];
		}
		if( ENDyear%400==i%400 )
		{
			ENDdate+=disyear[401]*( (ENDyear-i)/400 )+disyear[i];
		}
	}
	date=ENDdate-STARTdate;
	cout<<date<<endl;
}


void main()
{
	int y1,m1,d1;
	int y2,m2,d2;
	int days=0,month,year;
	scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
    for(year=y1+1;year<y2;year++)
	{
		if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) days=days+366;
		else days=days+365;
	}
	if(((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))&&m1<=2) days=days+1;
	for(month=m1;month<=12;month++)
	{
    switch(month)
	{
	case 1: days=days+31;break;
	case 2: days=days+28;break;
	case 3: days=days+31;break;
	case 4: days=days+30;break;
	case 5: days=days+31;break;
	case 6: days=days+30;break;
	case 7: days=days+31;break;
	case 8: days=days+31;break;
	case 9: days=days+30;break;
	case 10: days=days+31;break;
	case 11: days=days+30;break;
	case 12: days=days+31;break;
	}
	}
	days=days-d1;
    if(((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))&&m2>2) days=days+1;
	for(month=1;month<m2;month++)
	{
    switch(month)
	{
	case 1: days=days+31;break;
	case 2: days=days+28;break;
	case 3: days=days+31;break;
	case 4: days=days+30;break;
	case 5: days=days+31;break;
	case 6: days=days+30;break;
	case 7: days=days+31;break;
	case 8: days=days+31;break;
	case 9: days=days+30;break;
	case 10: days=days+31;break;
	case 11: days=days+30;break;
	case 12: days=days+31;break;
	}
	}
    days=days+d2;
	if(y1==y2)
	{
		if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0)) days=days-366;
		else days=days-365;
	}
    printf("%d\n",days);
}


int main()
{
	int startyear,startmonth,startday,endyear,endmonth,endday;
	int m[13],y[3001];
	int i,j,k,p;
	scanf("%d%d%d",&startyear,&startmonth,&startday);
	scanf("%d%d%d",&endyear,&endmonth,&endday);
	for(i=1;i<=12;i++)
	{
		if(i==1||i==3||i==5||i==7||1==8||i==10||i==12)
			m[i]=31;
		else if(i!=2)
			m[i]=30;
		else if(i==2&&(((endyear%4==0&&endyear%100!=0)||(endyear%400==0))||((startyear%4==0&&startyear%100!=0)||(startyear%400==0))))
			m[i]=29;
		else
			m[i]=28;
	}
	for(i=1;i<=3000;i++)
	{
		if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
			y[i]=366;
		else
			y[i]=365;
	}
	if(endyear==startyear)
	{
		if(endmonth!=startmonth)
		{
			for(i=startmonth+1,k=m[startmonth]-startday+endday+1;i<=endmonth-1;i++)
				k=k+m[i];
		}
		else
			k=endday-startday;
	}
	else if((startmonth<=2)&&((endmonth>2)||(endmonth==2&&endday==29)))
	{
		for(i=startmonth+1,k=m[startmonth]-startday+endday+1;i<=12;i++)
		{k=k+m[i];}
		for(j=endmonth-1;j>=1;j--)
		{k=k+m[j];}
		for(i=startyear+1;i<=endyear-1;i++)
		{
			k=k+y[i];
		}
	}
	else if(startyear!=endyear&&startmonth==endmonth&&startday==endday)
	{
		for(i=startyear,k=0;i<endyear;i++)
			k=k+y[i];
	}
	else
	{
		for(i=startmonth+1,k=m[startmonth]-startday+endday;i<=12;i++)
		{	k=k+m[i];}
		for(j=endmonth-1;j>=1;j--)
		{k=k+m[j];}
		for(i=startyear+1;i<=endyear-1;i++)
		{
			k=k+y[i];
		}
	}
	printf("%d",k);
	return 0;
}


int run(int a)
{
	int c;
	if(a%400==0||(a%4==0&&a%100!=0))
		c=1;
	else
		c=0;
	return c;
}
int dijitian(int y,int m,int d)
{
    int c,p=0,i;
	c=run(y);
    for(i=1;i<m;i++)
	{
		if(i==4||i==6||i==9||i==11)
		 p=p+30;
		else if(i==2&&c==1)
	      p=p+29;
		else if(i==2&&c==0)
			p=p+28;
		else
			p=p+31;

	 }
	p=p+d;
	return p;
}
void main()
{
	int y1,m1,d1,y2,m2,d2;
	int a,b,c=0,result,temp,i;
	scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
	a=dijitian(y1,m1,d1);
	b=dijitian(y2,m2,d2);
	if(y1==y2)
	{
        result=a-b;
		if(result<0)
			result=0-result;
	}
	else
	{
        if(y1>y2)
		{
            temp=y1;
			y1=y2;
			y2=temp;
			temp=m1;
			m1=m2;
			m2=temp;
			temp=d1;
			d1=d2;
			d2=temp;
		}
		if(run(y1)==1)
			a=366-a;
		else
			a=365-a;
		for(i=y1+1;i<y2;i++)
		{
			if(run(i)==1) c=c+366;
			else c=c+365;
		}
		result=a+b+c;
	}
	printf("%d",result);
}


int leap(int year);
int days(int year,int month,int day);
void main(){
	int y1,m1,d1,y2,m2,d2;
	int total=0,i;
	scanf("%d%d%d",&y1,&m1,&d1);
	scanf("%d%d%d",&y2,&m2,&d2);
	if(y1==y2)
		total=days(y2,m2,d2)-days(y1,m1,d1);
	else{

		if(leap(y1))
			total=366-days(y1,m1,d1);
		else{
			total=365-days(y1,m1,d1);
		}
		for(i=y1+1;i<y2;i++){
			if(leap(i))
				total+=366;
			else{
				total+=365;
			}
		}
		total+=days(y2,m2,d2);
	}
	printf("%d\n",total);
}

int leap(int year){
	if((year%4==0 && year%100!=0) || year%400==0)
		return 1;
	else{
		return 0;
	}
}

int days(int year,int month,int day){
	int i,days=0;      //???
	for(i=1;i<month;i++){
		if(i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12)
			days+=31;
		if(i==4 || i==6 || i==9 || i==11)
			days+=30;
		if(i==2){
			if(leap(year))
				days+=29;
			else{
				days+=28;
			}
		}
	}
	days+=day;
	return days;
}


int runnian(int y){
	int result;
	if(y%4==0&&y%100!=0||y%400==0){
		result=1;
	}
	else
		result=0;
	return result;
}
int dijitian(int year,int month,int day){
	int i,days=0,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	a[2]=28+runnian(year);
	for(i=1;i<month;i++){
		days=days+a[i];
	}
	days=days+day;
	return days;
}
int main(int argc, char* argv[])
{
	int runnian(int y);
	int dijitian(int year,int month,int day);
	int i,sum=0,final,y1,m1,d1,y2,m2,d2;
	scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);

	for(i=y1;i<y2;i++){
		sum=sum+365+runnian(i);
	}
	final=sum+dijitian(y2,m2,d2)-dijitian(y1,m1,d1);
	printf("%d",final);
	return 0;
}


int main()
{
	int sY,sM,sD,eY,eM,eD;
	int DiJiTian(int y,int m,int d);
    int isRunNian(int year);
	scanf("%d%d%d%d%d%d",&sY,&sM,&sD,&eY,&eM,&eD);
	int x,days=DiJiTian(eY,eM,eD)-DiJiTian(sY,sM,sD);
	for(x=sY;x<eY;x++)
	{
		if(isRunNian(x))
		{
			days=days+366;
		}
		else
			days=days+365;
	}
	printf("%d",days);
	return 0;
}
int DiJiTian(int y,int m,int d)
{
	int isRunNian(int year);
	int i,result=0;
	for(i=1;i<m;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			result+=31;
		else if(i==4||i==6||i==9||i==11)
			result+=30;
		else if(i==2)
		{
			if(isRunNian(y))
			{
				result+=29;
			}
			else
				result+=28;
		}
	}
	result+=d;
	return result;
}
int isRunNian(int year)
{
	int result1;
	if(year%400==0||(year%4==0)&&(year%100!=0))
	{
		result1=1;
	}
	else
		result1=0;
	return result1;
}


void main()
{
	int startYear,startMonth,startDay,endYear,endMonth,endDay,y,a,n,m,b,b2,x;
	scanf("%d%d%d%d%d%d",&startYear,&startMonth,&startDay,&endYear,&endMonth,&endDay);
    y=startYear;
	a=0;
	while(y<=endYear)
		{
		int f;
		   if((y%4==0&&y%100!=0)||(y%100==0&&y%400==0))
			   f=1;
			else f=0;
		   if(f==1)
			   a=a+1;
		 y=y+1;
	}
	if ((startYear%4==0&&startYear%100!=0)||(startYear%100==0&&startYear%400==0))
	a=a-1;
	if ((endYear%4==0&&endYear%100!=0)||(endYear%100==0&&endYear%400==0))
	a=a-1;
	n=a*366;
	if ((startYear%4==0&&startYear%100!=0)||(startYear%100==0&&startYear%400==0))
    {
	 if(startMonth==1)
		   b=0;
	   else if(startMonth==2)
		   b=31;
	   else if(startMonth==3)
		   b=60;
	   else if(startMonth==4)
		   b=91;
	   else if(startMonth==5)
	       b=121;
	   else if(startMonth==6)
		   b=152;
	   else if(startMonth==7)
		   b=182;
	   else if(startMonth==8)
		   b=213;
	   else if(startMonth==9)
		   b=244;
	   else if(startMonth==10)
	       b=274;
	   else if(startMonth==11)
		   b=305;
	   else
		   b=335;
	   }
	else
	{
	if(startMonth==1)
		   b=0;
	   else if(startMonth==2)
		   b=31;
	   else if(startMonth==3)
		   b=59;
	   else if(startMonth==4)
		   b=90;
	   else if(startMonth==5)
	       b=120;
	   else if(startMonth==6)
		   b=151;
	   else if(startMonth==7)
		   b=181;
	   else if(startMonth==8)
		   b=212;
	   else if(startMonth==9)
		   b=243;
	   else if(startMonth==10)
	       b=273;
	   else if(startMonth==11)
		   b=304;
	   else
		   b=334;
	   b=b+1;
	}

	if ((endYear%4==0&&endYear%100!=0)||(endYear%100==0&&endYear%400==0))
	{
	   if(endMonth==1)
		   b2=0;
	   else if(endMonth==2)
		   b2=31;
	   else if(endMonth==3)
		   b2=60;
	   else if(endMonth==4)
		   b2=91;
	   else if(endMonth==5)
	       b2=121;
	   else if(endMonth==6)
		   b2=152;
	   else if(endMonth==7)
		   b2=182;
	   else if(endMonth==8)
		   b2=213;
	   else if(endMonth==9)
		   b2=244;
	   else if(endMonth==10)
	       b2=274;
	   else if(endMonth==11)
		   b2=305;
	   else
		   b2=335;
	   }
	else
	{
	if(endMonth==1)
		   b2=0;
	   else if(endMonth==2)
		   b2=31;
	   else if(endMonth==3)
		   b2=59;
	   else if(endMonth==4)
		   b2=90;
	   else if(endMonth==5)
	       b2=120;
	   else if(endMonth==6)
		   b2=151;
	   else if(endMonth==7)
		   b2=181;
	   else if(endMonth==8)
		   b2=212;
	   else if(endMonth==9)
		   b2=243;
	   else if(endMonth==10)
	       b2=273;
	   else if(endMonth==11)
		   b2=304;
	   else
		   b2=334;
	}

	x=366-b-startDay+b2+endDay+366*a+(endYear-startYear-1-a)*365;
    printf("%d",x);
}


int calday(int year,int month,int day);
int main()

{
	int syear,smonth,sday,eyear,emonth,eday,tday1,tday2;
	scanf("%d %d %d",&syear,&smonth,&sday);
	scanf("%d %d %d",&eyear,&emonth,&eday);
	tday1=calday(syear,smonth,sday);
	tday2=calday(eyear,emonth,eday);
	printf("%d\n",tday2-tday1);
	return 0;
}

int calday(int year,int month,int day){
	int total=0, y, m, Feb;
	for(y=0;y<year;y++){
		Feb=((y%4==0&&y%100!=0)||(y%400==0))?29:28;
		for(m=0;m<=12;m++){
			if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){
				total+=31;
			}
			if(m==2){
				total+=Feb;
			}
			if(m==4||m==6||m==9||m==11){
				total+=30;
			}
		}
	}
	if(y==year){
		Feb=((y%4==0&&y%100!=0)||(y%400==0))?29:28;
		for(m=0;m<month;m++){
			if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){
				total+=31;
			}
			if(m==2){
				total+=Feb;
			}
			if(m==4||m==6||m==9||m==11){
				total+=30;
			}
		}
		if(m==month){
			total+=day;
		}
	}
	return total;
}


struct date {
   int year;
   int month;
   int day;
};
int main()
{
 struct date date1,date2;
 int days,days1=0,days2=0;
 int daytab[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
 int i;
 scanf("%d%d%d",&date1.year,&date1.month,&date1.day);
 scanf("%d%d%d",&date2.year,&date2.month,&date2.day);
 for(i=0;i<date1.month;i++)
 {
  days1 += daytab[i];
 }

 if(((date1.year%4==0&&date1.year%100!=0)||(date1.year%400==0) )&& date1.month>2)
 {
  days1++;
 }
 days1 += date1.day;

 if(date1.year<=date2.year)
 {
 for(i=date1.year;i<date2.year;i++)
 {
  days2 += 365;
  if(((i%4)==0&&(i%100)!=0)||(i%400==0))
  {
   days2++;
  }
 }
 }
 else
  {
 for(i=date2.year;i<date1.year;i++)
 {
  days1 += 365;
  if((i%4==0&&i%100!=0)||(i%400==0))
  {
   days1++;
  }
 }
 }

 for(i=0;i<date2.month;i++)
 {
  days2 += daytab[i];
 }

 if((date2.year%4==0&&date2.year%100!=0)||(date2.year%400==0) && date2.month>2)
 {
  days2 ++;
 }
 days2 += date2.day;

 days=abs(days2-days1);

 printf("%d\n",days);
 return 0;
}


int f(int year,int month,int day)
{  int days=0;
   int i;
   for(i=1;i<year;i++)
     {  if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
          {  days=days+366;
          }
        else days=days+365;
     }
   if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
    {   for(i=1;i<month;i++)
         {  if(i==1)  days=days+31;
            if(i==2)  days=days+29;
            if(i==3)  days=days+31;
            if(i==4)  days=days+30;
            if(i==5)  days=days+31;
            if(i==6)  days=days+30;
            if(i==7)  days=days+31;
            if(i==8)  days=days+31;
            if(i==9)  days=days+30;
            if(i==10)  days=days+31;
            if(i==11)  days=days+30;
            if(i==12)  days=days+31;
         }
    }
   else
     {  for(i=1;i<month;i++)
         {  if(i==1)  days=days+31;
            if(i==2)  days=days+28;
            if(i==3)  days=days+31;
            if(i==4)  days=days+30;
            if(i==5)  days=days+31;
            if(i==6)  days=days+30;
            if(i==7)  days=days+31;
            if(i==8)  days=days+31;
            if(i==9)  days=days+30;
            if(i==10)  days=days+31;
            if(i==11)  days=days+30;
            if(i==12)  days=days+31;
         }
     }
   days=days+day;
   return days;
}
int main()
{   int year1,month1,day1;
    cin>>year1>>month1>>day1;
    int year2,month2,day2;
    cin>>year2>>month2>>day2;
    int days1=f(year1,month1,day1);
    int days2=f(year2,month2,day2);
    int days=days2-days1;
    cout<<days;
    return 0;
}


int main()
{
	int styear,stmonth,stday;
	int enyear,enmonth,enday;
	int sum=0;
	int i,j,k;
	int year[2]={365,366};
	int yearmonth[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}};
	cin>>styear>>stmonth>>stday;
	cin>>enyear>>enmonth>>enday;
	if(styear==enyear)
	{
	    if(stmonth==enmonth)
			sum=enday-stday;
		else
			for(j=stmonth;j<=enmonth;j++)
				{
					if(j==stmonth)
					sum=sum+yearmonth[(styear % 4 == 0 && styear % 100 != 0) || (styear % 400 == 0)][j]-stday;
					else if(j==enmonth)
						sum=sum+enday;
					else
						sum=sum+yearmonth[(styear % 4 == 0 && styear % 100 != 0) || (styear % 400 == 0)][j];
			}
	}
	else
	{
		for(j=stmonth;j<=12;j++)
		{
			if(j==stmonth)
					sum=sum+yearmonth[(styear % 4 == 0 && styear % 100 != 0) || (styear % 400 == 0)][j]-stday;
			else
					sum=sum+yearmonth[(styear % 4 == 0 && styear % 100 != 0) || (styear % 400 == 0)][j];
		}
		styear++;
		while(styear<enyear)
			{
				sum=sum+year[(styear % 4 == 0 && styear % 100 != 0) || (styear % 400 == 0)];
				styear++;
		}
		j=1;
		while(j<enmonth)
		{
			sum=sum+yearmonth[(styear % 4 == 0 && styear % 100 != 0) || (styear % 400 == 0)][j];
			j++;
		}
		sum=sum+enday;
	}
	cout<<sum;

	return 0;
}


int judge_year(int year)  //?????????
{
	if(year%400==0)
		return 1;
	if(year%100==0)
		return 0;
	if(year%4==0)
		return 1;
	return 0;
}

int main()
{
	int i;
	int sumdays=0;
	int monthdays[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int startYear, startMonth, startDay;
	int endYear, endMonth, endDay;
	scanf("%d %d %d",&startYear,&startMonth,&startDay);
	scanf("%d %d %d",&endYear,&endMonth,&endDay);
	if(judge_year(startYear))  //???
	{
		monthdays[2]=29;  //????????
	}
	if(startYear==endYear)  //????
	{
		if(startMonth==endMonth)   //????
		{
			sumdays=endDay-startDay;
			printf("%d",sumdays);
			return 0;
		}
		else
		{
			for(i=startMonth+1;i<endMonth;i++)
			{
				sumdays+=monthdays[i];
			}
			sumdays+=monthdays[startMonth]-startDay;
			sumdays+=endDay;
			printf("%d",sumdays);
			return 0;
		}
	}
	//?????
	//??????????
	for(i=startYear+1;i<endYear;i++)
	{
		sumdays+=judge_year(i)+365;
	}
	//????????
	for(i=startMonth+1;i<=12;i++)
	{
		sumdays+=monthdays[i];
	}
	sumdays+=monthdays[startMonth]-startDay;
	//??????
	//????????
	if(judge_year(endYear))
		monthdays[2]=29;
	else
		monthdays[2]=28;
	for(i=1;i<endMonth;i++)
	{
		sumdays+=monthdays[i];
	}
	sumdays+=endDay;
	printf("%d",sumdays);
	return 0;
}


void main()
{
	int nian(int a,int b);
	int qian(int a,int b,int c);
	int hou(int a,int b,int c);
	int a,b,c,d,e,f,g,k;
	scanf("%d%d%d\n",&a,&b,&c);
	scanf("%d%d%d",&d,&e,&f);
	g=d-a;
	k=nian(a,g);
	if(g!=0)
	{k=k+qian(a,b,c);
	k=k+hou(d,e,f);}
	else
	{k=k+hou(d,e,f);
	k=k-hou(a,b,c);
	}
	printf("%d\n",k);
}

int nian(int a,int b)
{   int i,j=0;
	for(i=1;i<=b-1;i++)
	{if(((a+i) % 4 == 0 && (a+i) % 100 != 0) || ((a+i) % 400 == 0))
		j=j+366;
	else j=j+365;
	}
	return(j);
}

int qian(int a,int b,int c)
{
	int pd1(int a,int b);
	int pd2(int a,int b);
	int pd3(int a);
	int pd4(int a);
	int e=0,i,j;
	if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
     {
     e=pd1(b,c);
     for(i=b+1;i<=12;i++)
     {e=e+pd3(i);}}
     else
      {
     e=pd2(b,c);
     for(i=b+1;i<=12;i++)
     {e=e+pd4(i);}}
    return(e);
     }

int hou(int a,int b,int c)
{
	int pd3(int a);
	int pd4(int a);
	int e,i,j;
	e=c;
	if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
     {
     for(i=1;i<b;i++)
     {e=e+pd3(i);}}
     else
      {
     for(i=1;i<b;i++)
     {e=e+pd4(i);}}
    return(e);
     }

int pd1(int a,int b)
{switch(a)
	{case 1:return(31-b);break;
	case 2:return(29-b);break;
	case 3:return(31-b);break;
	case 4:return(30-b);break;
	case 5:return(31-b);break;
	case 6:return(30-b);break;
	case 7:return(31-b);break;
	case 8:return(31-b);break;
	case 9:return(30-b);break;
	case 10:return(31-b);break;
	case 11:return(30-b);break;
	case 12:return(31-b);break;
	default:return(0);}
}

int pd2(int a,int b)
{switch(a)
	{case 1:return(31-b);break;
	case 2:return(28-b);break;
	case 3:return(31-b);break;
	case 4:return(30-b);break;
	case 5:return(31-b);break;
	case 6:return(30-b);break;
	case 7:return(31-b);break;
	case 8:return(31-b);break;
	case 9:return(30-b);break;
	case 10:return(31-b);break;
	case 11:return(30-b);break;
	case 12:return(31-b);break;
	default:return(0);}
}

int pd3(int a)
{switch(a)
	{case 1:return(31);break;
	case 2:return(29);break;
	case 3:return(31);break;
	case 4:return(30);break;
	case 5:return(31);break;
	case 6:return(30);break;
	case 7:return(31);break;
	case 8:return(31);break;
	case 9:return(30);break;
	case 10:return(31);break;
	case 11:return(30);break;
	case 12:return(31);break;
	default:return(0);}
}

int pd4(int a)
{switch(a)
	{case 1:return(31);break;
	case 2:return(28);break;
	case 3:return(31);break;
	case 4:return(30);break;
	case 5:return(31);break;
	case 6:return(30);break;
	case 7:return(31);break;
	case 8:return(31);break;
	case 9:return(30);break;
	case 10:return(31);break;
	case 11:return(30);break;
	case 12:return(31);break;
	default:return(0);}
}


int B[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int A[12]={31,29,31,30,31,30,31,31,30,31,30,31};
int runnian(int year)
{
	if((year%4==0&&year%100!=0)||(year%400==0))
		return 1;
	else
		return 0;
}
int count1(int startmonth,int startday,int endmonth,int endday)
{
	int result=0,i;
	if(startmonth<=endmonth)
	{
		for(i=startmonth;i<endmonth;i++)
		{
			result=result+A[i-1];
		}
		result=result+endday-startday;
	}
	else
	{
		for(i=startmonth;i>endmonth;i--)
		{
			result=result-A[i-2];
		}
		result=result+endday-startday;
	}
	return result;
}
int count2(int startmonth,int startday,int endmonth,int endday)
{
    int result=0,i;
	if(startmonth<=endmonth)
	{
		for(i=startmonth;i<endmonth;i++)
		{
			result=result+B[i-1];
		}
		result=result+endday-startday;
	}
	else
	{
		for(i=startmonth;i>endmonth;i--)
		{
			result=result-B[i-2];
		}
		result=result+endday-startday;
	}
	return result;
}
int main()
{
	int startYear,startMonth,startDay;
	int endYear,endMonth,endDay;
	int i;
	int sum=0;
	int temp;
	scanf("%d%d%d",&startYear,&startMonth,&startDay);
	scanf("%d%d%d",&endYear,&endMonth,&endDay);
	if(startYear==endYear)
	{
		if(runnian(startYear))
		{
			sum=count1(startMonth,startDay,endMonth,endDay);
		}
		else
		{
			sum=count2(startMonth,startDay,endMonth,endDay);
		}
	}
	else
	{
		if(startYear>endYear)
		{
			temp=endYear;
			endYear=startYear;
			startYear=temp;
            temp=endMonth;
			endMonth=startMonth;
			startMonth=temp;
            temp=endDay;
			endDay=startDay;
			startDay=temp;
		}
	}
	if(startYear<endYear)
	{
		for(i=startYear;i<endYear;i++)
		{
			if(runnian(i))
			{
				sum=sum+366;
			}
			else
			{
				sum=sum+365;
			}
		}
        if(runnian(endYear))
		{
			sum=sum+count1(startMonth,startDay,endMonth,endDay);
		}
		else
		{
			sum=sum+count2(startMonth,startDay,endMonth,endDay);
		}
	}
	printf("%d",sum);
	return 0;
}


int g1[13] = {0 ,31,28,31,30,31,30,31,31,30,31,30,31};
int g2[13] = {0 ,31,29,31,30,31,30,31,31,30,31,30,31};
int Counting(int,int,int);
int IsLeapYear(int);
void main()
{
	int y1, m1, d1, y2, m2, d2,sum=0,i;
	int b1, b2;
	scanf("%d %d %d\n%d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
	for(i=y1;i<y2;i++)
	{
		if(IsLeapYear(i)==1)
		{
			sum+=366;
		}
		else
		{
			sum+=365;
		}
	}
	b1 = Counting(m1,d1,IsLeapYear(y1));
	b2 = Counting(m2,d2,IsLeapYear(y2));
	printf("%d",sum + b2 - b1 );
	return;

}

int IsLeapYear(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
	{
		return 1;
	}
	return 0;
}

int Counting(int month, int date, int leapYear)
{
	int count=0;
	int i;
	if(leapYear==1)
	{
		for(i=1;i<month;i++)
		{
			count+=g2[i];
		}
	}
	else
	{
		for(i=1;i<month;i++)
		{
			count+=g1[i];
		}
	}
	count+=date;
	return count;
}


int dayofy( int year )
{
	if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 366 ;
	else return 365 ;
}
int dayofm( int day , int mon , int year )
{
	int i , temp , sum = 0 ;
	for ( i = 1 ; i < mon ; i++ )
	{
	if ( i == 2 )
	{
		if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
			temp = 29 ;
		else temp = 28 ;
	}
	else if ( i == 4 || i == 6 || i == 9 || i == 11 )
		temp = 30 ;
	else temp = 31 ;
	sum += temp ;
	}
	return sum+day ;
}

int main ()
{
	int syear , smon , sday , eyear , emon , eday , i , j , disyear=0 , disday=0 ;
	cin >> syear >> smon >> sday >> eyear >> emon >> eday ;
	for ( i = syear ; i < eyear ; i++ )
	{
		disyear += dayofy(i) ;
	}
	disday = dayofm( eday ,emon , eyear ) - dayofm( sday , smon ,syear ) ;
	cout << disyear+disday << endl ;
	return 0 ;
}


int main()
{
	int startYear, startMonth, startDay, endYear, endMonth, endDay;
	int total=0, i;
	int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> startYear >> startMonth >> startDay;
	cin >> endYear >> endMonth >> endDay;
	if(startYear == endYear)
	{
		total-=startDay;
		total+=endDay;
		if((startYear % 4 == 0 && startYear % 100 != 0) || (startYear % 400 == 0) && (startMonth <= 2) && (endMonth > 2))
			day[1]++;
		for(i = startMonth; i<endMonth -1; i++)
			total+=day[i];
	}
	else
	{
		total = (endYear-startYear - 1)*365;
		for(int year = startYear + 1; year<endYear;year++)
		{
			if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
				total++;
		}
		total-=startDay;
		total+=endDay;
		for(i = startMonth-1; i<12;i++)
			total+=day[i];
		if((startYear % 4 == 0 && startYear % 100 != 0) || (startYear % 400 == 0) && (startMonth <= 2))
			total++;
		for(i = 0; i<endMonth-1;i++)
			total+=day[i];
		if((endYear % 4 == 0 && endYear % 100 != 0) || (endYear % 400 == 0) && (endMonth > 2))
			total++;
	}
	cout << total <<endl;

	return  0;
}


int main()
{
	int startyear, startmonth, startday;
	int endyear, endmonth, endday;
	int month[13] = {0, 31, 0,31, 30, 31, 30 ,31 ,31, 30 , 31, 30, 31}, year[2] = {365, 366}, i,  feb, num = 0;
	cin >> startyear >> startmonth >> startday;
	cin >> endyear>> endmonth >> endday;
	if(startyear == endyear)
	{
		feb = (endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0);
		month[2] = 28 + feb;
		if(startmonth == endmonth)
		{
			for(i = startday; i < endday; i++)
				num ++;
		}
		else
		{
			num += month[startmonth] - startday;
			for(i = startmonth + 1 ; i < endmonth; i++)
			{
				num += month[i];
			}
			num += endday;
		}
	}
	else
	{
		feb = (startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0);
		month[2] = 28 + feb;
		num += month[startmonth] - startday;
		for(i = startmonth + 1; i <= 12; i++)
			num += month[i];
	for(i = startyear + 1; i < endyear; i++)
	{
		feb = (i % 4 == 0 && i % 100 != 0) || (i % 400 == 0);
		month[2] = 28 + feb;
		num += year[feb];
	}
	feb = (endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0);
	month[2] = 28 + feb;

	for(i = 1; i < endmonth ; i++)
		num += month[i];
	num += endday;
	}
	cout << num << endl;
	return 0;
}


int yuandan(int year,int month,int day);
int main()
{
    int year1,year2,month1,month2,day1,day2,t;
    int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int yuandan1=0,yuandan2=0;
    int num=0;
    int i;
    cin>>year1>>month1>>day1;
    cin>>year2>>month2>>day2;
    if(year2<year1)
    {
     t=year1;year1=year2;year2=t;
     t=month1;month1=month2;month2=t;
     t=day1;day1=day2;day2=t;
    }
    yuandan1=yuandan(year1,month1,day1);
    yuandan2=yuandan(year2,month2,day2);

    for(i=year1;i<year2;i++)
    {
      num+=365;
      num+= ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0));
    }

    num=num+yuandan2-yuandan1;
    cout<<num;

return 0;
}
int yuandan(int year,int month,int day)
{
  int yue[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
  yue[2]=29;
  else
  yue[2]=28;

  int i,sum=0;
  if(month==1)
  return day;
  else
  {
    for(i=1;i<=month-1;i++)
    sum+=yue[i];
    sum+=day ;
  }
    return sum;
}


int main()
{
	int time1=0,time2=0,result=0;
   int year1,year2,month1,month2,day1,day2;
   cin>>year1>>month1>>day1>>year2>>month2>>day2;
   int dayofmonth[13]={31,28,31,30,31,30,31,31,30,31,30,31};
   int stayear=min(year1,year2);
   if(stayear%4==0&&stayear%100!=0||stayear%400==0)
	   dayofmonth[1]=29;
   for(int month=0;month<month1-1;month++)
	   time1+=dayofmonth[month];
   time1+=day1-1;
   dayofmonth[1]=28;
   for(int year=stayear;year<max(year1,year2);year++)
   {
      if(year%4==0&&year%100!=0||year%400==0)
	   time2+=366;
	  else time2+=365;
   }
	  int temp=max(year1,year2);
if(temp%4==0&&temp%100!=0||temp%400==0)
	   dayofmonth[1]=29;
for(int monthtemp=0;monthtemp<month2-1;monthtemp++)
	time2+=dayofmonth[monthtemp];
time2+=day2-1;
cout<<time2-time1<<endl;

return 0;
   }


int main()
{int year,month,startYear ,startMonth ,startDay ,endYear ,endMonth ,endDay,TOTAL1=0,TOTAL2=0;
scanf("%d %d %d\n%d %d %d",&startYear ,&startMonth ,&startDay,&endYear ,&endMonth ,&endDay);
for(year=1;year<startYear;year++)
{if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
  TOTAL1+=366;
else TOTAL1+=365;
}
for(month=1;month<startMonth;month++)
{if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
TOTAL1+=31;
else if(month==2&&((startYear% 4 == 0 && startYear% 100 != 0) || (startYear% 400 == 0)))
TOTAL1+=29;
else TOTAL1+=30;
}
TOTAL1+=startDay;

for(year=1;year<endYear;year++)
{if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
  TOTAL2+=366;
else TOTAL2+=365;
}
for(month=1;month<endMonth;month++)
{if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
TOTAL2+=31;
else if(month==2&&((endYear% 4 == 0 && endYear% 100 != 0) || (endYear% 400 == 0)))
TOTAL2+=29;
else TOTAL2+=30;
}
TOTAL2+=endDay;

printf("%d",TOTAL2-TOTAL1);
return 0;
}


int main()
{
	int year1,month1,date1,year2,month2,date2;                             //1?????2????//
	int year_2;                                                            //faciliate caculation//
	int year,month,date;
	scanf("%d%d%d\n%d%d%d",&year1,&month1,&date1,&year2,&month2,&date2);
	year_2=year2;
	if(date1<=date2) date=date2-date1;
	else
	{
		month2=month2-1;
		        if((month2<=7&&month2%2!=0)||(month2>7&&month2%2==0))     //????????????//
                date=date2-date1+31;
	            else if(month2!=2)
			    date=date2-date1+30;
                     else if((year2%4==0&&year2%100!=0)||(year2%400==0))           //????//
						  date=date2-date1+29;
					      else date=date2-date1+28;
	}
	if(month2>=month1) month=month2-month1;
	else
	{
		month=month2-month1+12;
		year_2=year2-1;
	}
	year=year_2-year1;

	/*???????????year??month??date?*/

	int day,monthday,yearday;                     //????????????????????????????//
	int monthday1=0,monthday2=0;
	day=0;
    monthday=0;
	int judgeyear2;                               //faciliate caculation//
	int i;
	if(month1+month>=12) judgeyear2=year_2;
	else judgeyear2=year2;
	for(i=1;i<=month1-1;i++)                         /*????????????*/
        if(i<=12)                                                                   //??+31???+30//
			if((i<=7&&i%2!=0)||(i>7&&i%2==0)) monthday1=monthday1+31;
			else
				if(i==2)
				{
				    if((year1%4==0&&year1%100!=0)||(year1%400==0))           //????//
			                  monthday1=monthday1+29;
	                else monthday1=monthday1+28;
				}
				 else monthday1=monthday1+30;
	for(i=1;i<=month1+month-1;i++)                                      /*????????????*/
		if(i>12)
			if(((i-12)<=7&&(i-12)%2!=0)||((i-12)>7&&(i-12)%2==0)) monthday2=monthday2+31;
			else
				if((i-12)==2)
				{
				    if((year2%4==0&&year2%100!=0)||(year2%400==0))           //????//
			                  monthday2=monthday2+29;
	                else monthday2=monthday2+28;
				}
				 else monthday2=monthday2+30;
		else
			if((i<=7&&i%2!=0)||(i>7&&i%2==0)) monthday2=monthday2+31;
			else
				if(i==2)
				{
				    if((judgeyear2%4==0&&judgeyear2%100!=0)||(judgeyear2%400==0))           //????//
			                  monthday2=monthday2+29;
	                else monthday2=monthday2+28;
				}
				 else monthday2=monthday2+30;
	monthday=monthday2-monthday1;
	yearday=365*year;                                        /*??????365????????????????*/
    int j;
	year2=year_2;
	for(j=year1;j<=year2-1;j++)
	    if((j%4==0&&j%100!=0)||(j%400==0))
			yearday=yearday+1;
		else continue;
	day=date+monthday+yearday;

	printf("%d\n",day);

	return 0;

}


int main()
{

    int startyear,startmonth,startday,endyear,endmonth,endday,i,sum;
    int a[13];
    sum=0;
    scanf("%d%d%d\n%d%d%d",&startyear,&startmonth,&startday,&endyear,&endmonth,&endday);
    for(i=1;i<=12;i++)//??
	{

        if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			a[i]=31;
		}
        else if(i==2)
		{
            a[i]=28;
		}
        else if(i==4||i==6||i==9||i==11)
		{
            a[i]=30;}
	}

     if (startyear==endyear)
	 {
         while ((startmonth<endmonth)||((startmonth==endmonth)&&(startday<endday)))
		 {
              if ((startyear%4==0&&startyear%100!=0)||(startyear%400==0))
			  {
                   a[2]++;
			  }
              startday++;
              sum=sum+1;
              if (endday>a[startmonth])
			  {
                  startday=0;	//not 1
                  startmonth=startmonth+1;
			  }
		 }
	 }
              else
			  {
                  for (i=startyear+1;i<=endyear-1;i++)
				  {
                       if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
                       sum=sum+366;
                       else sum=sum+365;
				  }
                       sum=sum+a[startmonth]-startday;//the first month
                       for (i=startmonth+1;i<=12;i++)
					   {
                           sum=sum+a[i];
					   }
                       if ((startmonth==1)&&((startyear%4==0&&startyear%100!=0)||(startyear%400==0)))
					   {
                            sum++;
					   }
                       for (i=1;i<=endmonth-1;i++)
					   {
                           sum=sum+a[i];
					   }
                       if ((endmonth>2)&&((endyear%4==0&&endyear%100!=0)||(endyear%400==0)))
					   {
                           sum++;
					   }
                       sum+=endday;
			  }
   printf("%d",sum);
   return 0;
}


int leapYear(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	return 0;
}
int main()
{
	int month[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}};
	int i,startYear,endYear,startMonth,endMonth,startDay,endDay,count = 0;
	scanf("%d%d%d",&startYear,&startMonth,&startDay);
	scanf("%d%d%d",&endYear,&endMonth,&endDay);
	if(startYear < endYear)
	{
		for(i = startMonth + 1; i <= 12; i++)
		{
			count += month[leapYear(startYear)][i];
		}
		for(i = 1; i < endMonth; i++)
		{
			count += month[leapYear(endYear)][i];
		}
		count += month[leapYear(startYear)][startMonth] - startDay;
		count += endDay;
	}else{
		for(i = startMonth + 1; i < endMonth; i++)
		{
			count += month[leapYear(startYear)][i];
		}
		if(startMonth < endMonth)
		{
			count += month[leapYear(startYear)][startMonth] - startDay;
			count += endDay;
		}else{
			count += endDay - startDay;
		}
	}
	for(i = startYear + 1;i < endYear; i++)
	{
		count += 365 + leapYear(i);
	}
	printf("%d",count);
	return 0;
}


int func(int,int,int);
int main()
{
 int startYear,startMonth,startDay,endYear,endMonth,endDay;
 cin>>startYear>>startMonth>>startDay>>endYear>>endMonth>>endDay;
 cout<<func(endYear,endMonth,endDay)-func(startYear,startMonth,startDay);
 return 0;
}
int func(int year,int month,int day)
{
 int sum=0,i,mping[12]={31,28,31,30,31,30,31,31,30,31,30,31},mrun[12]={31,29,31,30,31,30,31,31,30,31,30,31};
 for(i=1;i<year;i++)
  if((i%4==0&&i%100!=0)||(i%400==0))
   sum+=366;
  else
   sum+=365;
 if((year%4==0&&year%100!=0)||(year%400==0))
  for(i=0;i<month-1;i++)
   sum+=mrun[i];
 else
  for(i=0;i<month-1;i++)
   sum+=mping[i];
 sum+=day;
 return sum;
}


int main()
{
	int startYear,startMonth,startDay,endYear,endMonth,endDay;                           //???????????
	scanf("%d%d%d%d%d%d",&startYear,&startMonth,&startDay,&endYear,&endMonth,&endDay);   //???????????
	int sum=0,sumYear=0,sumMonth=0,sumDay=0;                                             //????????????????
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};                                     //????12?????
	int b[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};                                     //????12?????
	int i;
    //??????????
	{
	    if(startDay<endDay)
	        {
			    for(i=startDay;i<endDay;i++) sumDay+=1;
	        }
	    else if(startDay>endDay)
	        {
			    for(i=startDay;i>endDay;i--) sumDay-=1;
		    }
    }
    //??????????
	{
		if(startMonth<endMonth)
		    {
				if((endYear%4==0&&endYear%100!=0)||(endYear%400==0))
				    {
						for(i=startMonth;i<endMonth;i++) sumMonth+=b[i];                //??????????????
					}
				else
				    for(i=startMonth;i<endMonth;i++) sumMonth+=a[i];
			}
		else if(startMonth>endMonth)
		    {
				if((endYear%4==0&&endYear%100!=0)||(endYear%400==0))
				    {
						for(i=startMonth;i>endMonth;i--) sumMonth-=b[i];
					}
				else
				    for(i=startMonth;i>endMonth;i--) sumMonth-=a[i];
			}
	}
	//??????????
	{
		if(startYear<endYear)
		   {
				for(i=startYear;i<endYear;i++)
				{
					if((i%4==0&&i%100!=0)||(i%400==0)) sumYear+=366;
					else sumYear+=365;
				}
		   }
	}
	sum=sumDay+sumMonth+sumYear;
	printf("%d",sum);
	return 0;
}


int main()
{
    int month1[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}, month2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
    int startYear, startMonth, startDay;
    int endYear, endMonth, endDay;
    int deltaDay = 0, i = 0;
    int day1 = 0, day2 = 0, day = 0;

    cin >> startYear >> startMonth >> startDay;
    cin >> endYear >> endMonth >> endDay;

    for(i = startYear; i < endYear; i++)
    {
        if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
        day = day + 366;
        else
        day = day + 365;
    }

    i = startYear;
    if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
    {
        for(int j = 1; j < startMonth; j++)
        {
            day1 = day1 + month2[j];
        }
    }
    else
    {
        for(int j = 1; j < startMonth; j++)
        {
            day1 = day1 + month1[j];
        }
    }
    day1 = day1 + startDay;

    i = endYear;
    if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
    {
        for(int j = 1; j < endMonth; j++)
        {
            day2 = day2 + month2[j];
        }
    }
    else
    {
        for(int j = 1; j < endMonth; j++)
        {
            day2 = day2 + month1[j];
        }
    }
    day2 = day2 + endDay;

    deltaDay = day2 - day1 + day;

    cout << deltaDay;

    return 0;
}


int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int rdays[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int ryear(int year)
{
	return year%4==0&&year%100!=0||year%400==0;
}
int sum1(int year,int month, int day)
{
	int i,restday=day;
	for(i=1;i<month;i++)
	{
		if(ryear(year)) restday=restday+rdays[i];
		else restday=restday+days[i];
	}
	return restday;
}
int main()
{
	int sy,sm,sd,ey,em,ed;
	scanf("%d%d%d %d%d%d",&sy,&sm,&sd,&ey,&em,&ed);
	int i,sum=0;
	for(i=sy+1;i<ey;i++)
	{  if(ryear(i)==1) sum+=366;
	   else sum+=365;
	   }
	int start=sum1(sy,sm,sd);
	int end=sum1(ey,em,ed);
	if(sy==ey) sum=sum+end-start;
	else
	{
		sum=sum+end+365-start;
	    if(ryear(sy)) sum++;
	}
	printf("%d",sum);
}


int main()
{
	int answer=0,startYear,startMonth,startDay,endYear,endMonth,endDay;
	cin>>startYear>>startMonth>>startDay;
	cin>>endYear>>endMonth>>endDay;
	int d[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int gap;
	gap=endYear-startYear;
	int judge1,judge2,mid;
	judge1=((endYear%400==0)||(endYear%4==0&&endYear%100!=0));
	judge2=((startYear%400==0)||(startYear%4==0&&startYear%100!=0));
        if(startYear==endYear&&startMonth==endMonth&&startDay==endDay)
          {cout<<"0";
           return 0;}
	if(startMonth>endMonth)
		{
			mid=0;
			for(int i=endMonth-1;i<startMonth-1;i++)
			{mid+=d[i];}
		       mid+=(startDay-endDay);
		answer-=mid;
		}
		else
		{
			mid=0;
			for(int i=startMonth-1;i<endMonth-1;i++)
				mid+=d[i];
			mid+=(endDay-startDay);
			answer+=mid;
		}
		   answer+=365*gap;
			for(int k=startYear+1;k<endYear;k++)
				answer+=(k%400==0||(k%4==0&&k%100!=0));
	        if((startMonth<2&&judge2==1)||((startMonth==2&&startDay!=29)&&judge2==1))
				answer++;
			  if(endMonth>2&&judge1==1)
				answer++;
			cout<<answer;
			return 0;
}


int leap(int year)
{

	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	else return 0;

}

int main()
{

	int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int syear=0, eyear=0, smonth=0, emonth=0, sday=0, eday=0;
	int nleap=0;
	int nyears=0;
	int startYearDays=0;
	int endYearDays=0;
	int totaldays=0;
	cin>>syear>>smonth>>sday;
	cin>>eyear>>emonth>>eday;

	for(int i=syear; i<=eyear; i++)
	{
		if(leap(i))
			nleap++;

	}

	nyears=(eyear-syear)-1;

	for(int i=smonth+1; i<=12; i++)
	{
		startYearDays=startYearDays+month[i];

	}

	startYearDays=startYearDays+(month[smonth]-sday);

	//	cout<<startYearDays;

	//	cout<<endl;

//===================================== days in start year correct================================

	for(int i=1; i<=emonth-1; i++)
	{
		endYearDays=endYearDays+month[i];

	}

	endYearDays=endYearDays+eday;

//	cout<< endYearDays<<endl;

	totaldays=(nyears)*365+endYearDays+startYearDays+nleap;

	cout<<totaldays;

return 0;

}


int main()
{
	int startyear,startmonth,startday,endyear,endmonth,endday,year,month;
	int a[13]={31,28,31,30,31,30,31,31,30,31,30,31};
    int day;
	int i=0;
	scanf("%d%d%d",&startyear,&startmonth,&startday);
	scanf("%d%d%d",&endyear,&endmonth,&endday);
	day=0;
	for(year=startyear;year<endyear;++year)
	{
		day=day+365;
	}
	if(startmonth<endmonth)
	{
		for(month=startmonth;month<endmonth;++month)
		{
			day=day+a[month-1];
		}
	}
	else if(startmonth>endmonth)
	{
		for(month=startmonth;month>endmonth;--month)
		{
			day=day-a[month];
		}
	}
	day=day+endday-startday;
	for(year=startyear;year<=endyear;++year)
	{
		if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ++i;
	}
	if(((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0))&&(startmonth>2))
		i=i-1;
	if(((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0))&&(endmonth<2))
		i=i-1;
	day=day+i;
	printf("%d\n",day);
	return 0;
}


int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};//??????
int startYear, startMonth, startDay, endYear, endMonth, endDay;
void main()
{

	scanf("%d %d %d", &startYear, &startMonth, &startDay);
	scanf("%d %d %d", &endYear,   &endMonth,   &endDay  );

	int f(int), h1(int), h2(int), g(int, int);//f????????h????????g?????365??????????
	int i, sum=0, result;//sum?startYear?endYear??????(??????)

	if (startYear != endYear)
	{
		for (i=startYear+1; i<endYear; i++)
			if ( f(i)==1 )  sum = sum + 1;
		//printf("%d\n",sum);
		//printf("%d\n",g(startMonth, startDay));
		//printf("%d\n",(f(startYear) && h1(startMonth)));
		//printf("%d\n",g(endMonth, endDay));
		//printf("%d\n",(f(endYear) && h2(endMonth)));
		result=365-g(startMonth, startDay)+(f(startYear) && h1(startMonth)) +
		(endYear-startYear-1)*365 + sum +
		g(endMonth, endDay)+(f(endYear) && h2(endMonth));
	}
	else {
		result=g(endMonth,endDay) - g(startMonth,startDay) + (f(startYear) && h1(startMonth) && h2(endMonth));
	};
	printf("%d", result);
}
int f(int year)//????
{
	return( (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) ) ;//1????0????
}
int h1(int mon)//????1
{
	return(mon<=2);
}
int h2(int mont)//????2
{
	return(mont>2);
}
int g(int m, int d)
{
	int i, fromto=0;
	for(i=1; i<m; i++) {
		fromto=fromto+month[i];
	//	if (f(startYear) && (m == 2)) fromto++;
	}
	return (fromto+d);
}


int day[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int leapday[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int leapyear (int n)
{
	return ((n%4==0 && n%100!=0) || (n%400==0));
}
int count (int a,int b,int c)
{
	int leapyear(int n);
	int m=0,i;
	if (leapyear(a)==0)
	{
		for (i=0;i<b;i++)
		{
			m=m+day[i];
		}
	}
	else
	{
		for (i=0;i<b;i++)
		{
			m=m+leapday[i];
		}
	}
	m=m+c;
	return m;
}
int main()
{
	int j,a,b,c,d,e,f,sum=0;
	int leapyear(int n);
	int count(int a,int b,int c);
	scanf("%d %d %d\n%d %d %d",&a,&b,&c,&d,&e,&f);
	if (a<d)
	{
	    for (j=a;j<d;j++)
		{
			if (leapyear(j)==0)
			{
				sum=sum+365;
			}
			else if (leapyear(j)==1)
			{
				sum=sum+366;
			}
		}
		sum=sum+count(d,e,f)-count(a,b,c);
	}
	else if (a==d)
	{
		sum=count(d,e,f)-count(a,b,c);
	}
	printf("%d",sum);
	return 0;
}


int main()
{
	int startYear,startMonth,startDay, endYear,endMonth,endDay;
	int i,day=0;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>startYear>>startMonth>>startDay>>endYear>>endMonth>>endDay;
	for(i=startYear+1;i<endYear;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0)
			day=day+366;
		else day=day+365;
	}
	if(startYear<endYear)
	{
		for(i=startMonth+1;i<=12;i++)
		day=day+m[i];
	for(i=1;i<endMonth;i++)
		day=day+m[i];
	day=day+m[startMonth]-startDay;
	day=day+endDay;
	if((startYear%4==0&&startYear%100!=0||startYear%400==0)&&startMonth<3)
		day=day+1;
	if((endYear%4==0&&endYear%100!=0||endYear%400==0)&&endMonth>=3)
		day=day+1;
	}
	else
	{
		if(startMonth<endMonth)
		{
			for(i=startMonth+1;i<endMonth;i++)
				day=day+m[i];
			day=m[startMonth]-startDay+endDay;
		}
		else day=endDay-startDay;
	}
	cout<<day;
	return 0;

}


int leapYear(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 366;
	else return 365;
}
int main ()
{
	int startYear = 0, startMonth = 0, startDay = 0, endYear = 0, endMonth = 0, endDay = 0;//???????
	cin >> startYear >> startMonth >> startDay >> endYear >> endMonth >> endDay;
	int sum = 0, i = 0, j = 0;
	int leap[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
		ping[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	for(i = startYear; i < endYear; i++)
		sum = sum + leapYear(i);
	for(i = 1; i < startMonth; i ++)
	{
		if(leapYear(startYear == 366))
			sum = sum - leap[i];
		else
			sum = sum - ping[i];
	}
	sum = sum - startDay;
	for(i = 1; i < endMonth; i ++)
	{
		if(leapYear(endYear == 366))
			sum = sum + leap[i];
		else
			sum = sum + ping[i];
	}
	sum = sum + endDay;
	cout << sum;

	return 0;
}


const int monthlength[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};

inline int isLeapYear(int yearAD)
{
	if (yearAD % 4 == 0 && (yearAD % 100 != 0 || yearAD % 400 == 0))
		return 1;
	return 0;
}

int main()
{
	int y1, y2, m1, m2, d1, d2, delta;
	cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
	delta = d2 - d1;
	if (m1 < m2)
	{
		for (; m1 < m2; m1++)
		{
			if (m1 == 2)
				delta += 28 + isLeapYear(y1) + isLeapYear(y2);
			else
				delta += monthlength[m1];
		}
	}
	else
	{
		for (; m1 > m2; m1--)
		{
			if (m1 == 2)
				delta -= 28 + isLeapYear(y1) + isLeapYear(y2);
			else
				delta -= monthlength[m1];
		}
	}
	for (; y1 < y2; y1++)
		if (isLeapYear(y1))
			delta += 366;
		else
			delta += 365;
	cout << delta;
	return 0;
}


// ???????.cpp

int main()
{
	int y1, m1, d1, y2, m2, d2;
	int i, num = 0, k;
	cin >> y1 >> m1 >> d1;
	cin >> y2 >> m2 >> d2;
	k = ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0));
	for (i = y1; i < y2; i++)
		num = num + 365 + ((i % 4 == 0  && i % 100 != 0) || (i % 400 == 0));
	for (i = 1; i < m1; i++)
	{
		switch (i)
		{
		case 1: num = num - 31; break;
		case 2: num = num - (28 + k); break;
		case 3: num = num - 31; break;
		case 4: num = num - 30; break;
		case 5: num = num - 31; break;
		case 6: num = num - 30; break;
		case 7: num = num - 31; break;
		case 8: num = num - 31; break;
		case 9: num = num -30; break;
		case 10: num = num - 31; break;
		case 11: num = num - 30; break;
		}
	}
	num = num - d1 + d2;
	k = ((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0));
	for (i = 1; i < m2; i++)
	{
		switch (i)
		{
		case 1: num = num + 31; break;
		case 2: num = num + (28 + k); break;
		case 3: num = num + 31; break;
		case 4: num = num + 30; break;
		case 5: num = num + 31; break;
		case 6: num = num + 30; break;
		case 7: num = num + 31; break;
		case 8: num = num + 31; break;
		case 9: num = num + 30; break;
		case 10: num = num + 31; break;
		case 11: num = num + 30; break;
		}
	}
	cout << num << endl;
	return 0;
}


int main()
{
	int total(int year,int month,int day);
	int yearo, montho, dayo, totalo,totalt,yeart, montht, dayt,t,y,i,temp=0;
	scanf("%d %d %d",&yearo, &montho, &dayo);
	scanf("%d %d %d",&yeart, &montht, &dayt);
//	if((yearo>yeart)||((yearo=yeart)&&(montho>montht))||((yearo=yeart)&&(montho=montht)&&(dayo>dayt)))

//	{	totalo=total(yeart, montht, dayt);
//		totalt=total(yearo, montho, dayo);
//		yearo=y;
///		yearo=yeart;
//		yeart=y;
//	}
//	else
//			{
				totalo=total(yearo, montho, dayo);
		totalt=total(yeart, montht, dayt);
//	}
	t=totalt-totalo+365*(yeart-yearo);
	for(i=yearo;i<=yeart;i++)
	{
		if(((i % 4 == 0) &&( i % 100 != 0))|| (i % 400 == 0))
		t++;
	}
			printf("%d",t);
	return 0;
}

int total(int year,int month,int day)
{	int i;
		int mday[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
		int total=0;
		for( i=1; i<month; i++)
		{
			total = total + mday[i-1];
		}
//		if( ((year%4==0&&year%100!=0) || year%400==0 )&&(month>2))
//			total = total + 1;
		total = total + day;
	return total;
}


int main()
{
	int by,bm,bd;
	cin >> by >> bm >> bd;
	int ey, em ,ed;
	cin >> ey >> em >> ed;
	int sum = 0;
	for (int i = by + 1; i < ey; i++)
	{
		int leap = (i % 400 == 0) || (i % 100 != 0 && i % 4 == 0);
		sum = sum + (leap == 1 ? 366 : 365);
	}
	int temp = by == ey ? em : 12;
	for (int i = bm; i <= temp; i++)
	{
		int leapb = (by % 400 == 0) || (by % 100 != 0 && by % 4 == 0);
		if (i == 2)
		{
			if (leapb)
				sum += 29;
			else
				sum += 28;
		}
		switch (i)
		{

			case 1:sum += 31; break;
			case 3:sum += 31; break;
			case 5:sum += 31; break;
			case 7:sum += 31; break;
			case 8:sum += 31; break;
			case 10:sum += 31; break;
			case 12: sum += 31; break;
			case 4:sum += 30; break;
			case 6:sum += 30; break;
			case 9:sum += 30; break;
			case 11: sum += 30; break;
		}
	}
	sum -= bd;
	temp = by == ey ? bm : 1;
	for (int i = temp; i <= em - 1; i++)
	{
		int leape = (ey % 400 == 0) || (ey % 100 != 0 && ey % 4 == 0);
		if (i == 2)
		{
			if (leape)
				sum += 29;
			else
				sum += 28;
		}
		switch (i)
		{
			case 1:sum += 31; break;
			case 3:sum += 31; break;
			case 5:sum += 31; break;
			case 7:sum += 31; break;
			case 8:sum += 31; break;
			case 10:sum += 31; break;
			case 12: sum += 31; break;
			case 4:sum += 30; break;
			case 6:sum += 30; break;
			case 9:sum += 30; break;
			case 11: sum += 30; break;
		}
	}
	sum += ed;
	if (by == ey && bm == em)
	{
		int leape = (ey % 400 == 0) || (ey % 100 != 0 && ey % 4 == 0);
		if (bm == 2)
		{
			if (leape)
				sum -= 29;
			else
				sum -= 28;
		}
		switch (bm)
		{
			case 1:sum -= 31; break;
			case 3:sum -= 31; break;
			case 5:sum -= 31; break;
			case 7:sum -= 31; break;
			case 8:sum -= 31; break;
			case 10:sum -= 31; break;
			case 12: sum -= 31; break;
			case 4:sum -= 30; break;
			case 6:sum -= 30; break;
			case 9:sum -= 30; break;
			case 11: sum -= 30; break;
		}
	}

	cout << sum << endl;
	return 0;
}


int DiJiTian(int year,  int month,  int day);
int isRunNian(int   year);
void swap(int *a,  int *b);
int main()
{
	int a,b,c,i;
	int  year1,  month1,  day1;
	int  year2,  month2,  day2;
	int  result = 0;

	scanf( "%d %d %d",  &year1,  &month1,  &day1);
	scanf( "%d %d %d",  &year2,  &month2,  &day2);

	if(year1==year2)
	{
		result = DiJiTian(year1, month1, day1) - DiJiTian(year2, month2, day2);
        if(result < 0)
			result = 0 - result;
	}
	else
	{
		if(year1 > year2)
		{
	        swap(&year1, &year2);
	        swap(&month1, &month2);
          	swap(&day1, &day2);
		}
		if( isRunNian(year1) )
	        a = 366 - DiJiTian(year1, month1, day1);
        else
        	a = 365 - DiJiTian(year1, month1, day1);
		b = 0;
        for( i = year1 + 1; i < year2; i++){
        	if(isRunNian(i))
	        	b += 366;
        	else
        		b += 365;
		}
		c = DiJiTian(year2, month2, day2);
		result=a+b+c;
	}
	printf("%d",result);
	return 0;
}
int isRunNian(int year){
	int result;
	if( year%400 == 0 ||(year%4==0 && year%100!=0) )
		result = 1;
	else
		result = 0;
	return   result;
}
int DiJiTian(int year, int month, int day)
{
        int  result = 0,  i;
        for( i = 1;  i < month;  i++){ 	//step1
	if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
	        result += 31;
	 else  if (i == 4 || i ==6 || i == 9 || i==11)
  	        result += 30;
	else   if(i == 2){
	        if( isRunNian(year) )
		result += 29;
	        else
		result += 28;
	}
       }
       result += day;         //step2
       return  result;
}
void swap(int *a, int *b)
{
	int e;
	e = *a;
	*a = *b;
	*b = e;
}


int month[13]={0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int yadd(int y)
{
 if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) return 1;
 else return 0;
}
int madd(int y, int m)
{
 if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))
	 if (m == 2) return 1;
 return 0;
}
int ydays(int y1, int y2)
{
	int ans = 0;
	while (y1!=y2)
	{
		ans += yadd(y1) + 365;
		y1++;
	}
	return ans;
}
int mdays(int y, int m, int d)
{
	int ans=0, i, j;
	// month
	i=1;
	while (i<m)
	{
		ans += month[i] + madd(y, i);
		i++;
	}
	ans += d;
	return ans;
}
int main(){
	int y1, y2, m1, m2, d1, d2;
	int ans;
	scanf("%d %d %d", &y1, &m1, &d1);
	scanf("%d %d %d", &y2, &m2, &d2);
	ans = ydays(y1, y2) - mdays(y1, m1, d1) + mdays(y2, m2, d2);
	printf("%d", ans);
	return 0;
}


int djt(int year,int month,int day);
int main()
{
	  int a,b,c,d,e,f,g,h,s,i;
	scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
	g=djt(a,b,c);h=djt(d,e,f);s=h-g;
	for(i=a;i<d;i++)
	{
		if(i%400==0||(i%4==0&&i%100!=0))
			s+=366;
		else
			s+=365;
	}
			printf("%d\n",s);
	return 0;
}
int djt(int year,int month,int day)
{
	int sum,leap;
	  switch(month) /*?????????????*/
  {
    case 1:sum=0;break;
    case 2:sum=31;break;
    case 3:sum=59;break;
    case 4:sum=90;break;
    case 5:sum=120;break;
    case 6:sum=151;break;
    case 7:sum=181;break;
    case 8:sum=212;break;
    case 9:sum=243;break;
    case 10:sum=273;break;
    case 11:sum=304;break;
    case 12:sum=334;break;
    default:printf("data error");break;
  }
  sum=sum+day; /*????????*/
  if(year%400==0||(year%4==0&&year%100!=0)) /*???????*/
    leap=1;
  else
    leap=0;
  if(leap==1&&month>2) /*??????????,????????*/
    sum++;
  return sum;
}


int main()
{
	int i, year, startyear, startmonth, startday, endyear, endmonth, endday, sum = 0;
	int a[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	cin >> startyear>> startmonth>> startday>> endyear>> endmonth>> endday;
	if ((endyear - startyear) > 1)
	{
		for (year = startyear + 1; year < endyear; year++)
		{
			if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
				sum += 366;
			else
				sum += 365;
		}
		for (i = startmonth - 1; i < 12; i++)
			sum += a[i];
		sum -= startday;
		for (i = 0; i < endmonth - 1; i++)
			sum += a[i];
		sum += endday;
	}
	else if ((endyear - startyear) == 1)
		{
		for (i = startmonth; i < 12; i++)
			sum += a[i];
		sum -= startday;
		for (i = 0; i < endmonth; i++)
			sum += a[i];
		sum += endday;
		}
	else
	{
		for (i = startmonth; i < endmonth - 1; i++)
			sum += a[i];
		if (startmonth != endmonth)
			sum = sum + a[startmonth - 1] - startday + endday;
		else
			sum = sum + endday - startday;
	}
	if ((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0))
		if (startmonth == 1 || (startmonth == 2 && startday != 29))
			sum++;
	if ((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0))
		if (endmonth > 2)
			sum++;
	cout << sum;
	return 0;
}


/*
 * qimokaoshi_3.cpp
 *??:???????????
 *  Created on: 2011-1-9
 *      Author: jsgl
 */

int year1,year2,month1,month2,day1,day2,d1,d2=0,i;
int a[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
int ntianshu(int year)
{
    if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
       return 366;
    return 365;
}
int tianshu(int y,int m,int d)
{
	if(ntianshu(y)==366)  a[2]=29;
	else a[2]=28;
	int day=0;
	for(int i=1;i<=m-1;i++)
		day=day+a[i];
	return day+d;
}
int main()
{
	cin>>year1>>month1>>day1;
	cin>>year2>>month2>>day2;
	d1=tianshu(year1,month1,day1);
	for(i=year1;i<=year2-1;i++)
		d2=d2+ntianshu(i);
	d2=d2+tianshu(year2,month2,day2);
	cout<<d2-d1;
return 0;
}


int mds[2][12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
                  31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int leap(int year)
{
    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
    return 1;
    return 0;
}

int days(int sm, int sd, int em, int ed, int y)
{
    int lm, ld, um, ud;
    int total;
    if (sm < em)
    {
        lm = sm; um = em; ld = sd; ud = ed;
    }
    else if (sm > em)
    {
         lm = em; um = sm; ld = ed; ud = sd;
    }
    else if (sm == em)
    {
         if (sd > ed) return (sd - ed);
         return (ed - sd);
    }
    for (int i = lm; i < um; i++)
        total += mds[leap(y)][i - 1];
    if (ud > ld) total += ud - ld;
    else total -= ud - ld;
    return total;
}

int main()
{
    int sy, sm, sd, ey, em, ed, cd = 0;
    cin >> sy >> sm >> sd >> ey >> em >> ed;
    int i;
    for (i = sy; i < ey; i++)
        cd += leap(i) + 365;
    if (em > sm || (em == sm && ed >= sd))
        cd += days(sm, sd, em, ed, ey);
    else cd -= days(sm, sd, em, ed, ey) - 1;
    cout << cd << endl;
    return 0;
}


int main ( )
{
	int i, j, num = 0, startYear, startMonth, startDay, endYear, endMonth, endDay,
		Year[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> startYear >> startMonth >> startDay >> endYear >> endMonth >> endDay;
	if (startYear == endYear)
	{
		if((startYear % 4 == 0 && startYear % 100 != 0)||(startYear % 400 == 0))
				Year[1] = 29;
		else Year[1] = 28;
		if(startMonth == endMonth)
			num = num + endDay - startDay;
		else
		{
			for (i = startMonth-1;i < endMonth;i++)
			{
				if(i == startMonth-1)
					num = num + Year[i] - startDay;
				else if(i == endMonth-1)
					num = num + endDay;
				else num = num + Year[i];
			}
		}
	}
	else
	{
		for(j = startYear;j <= endYear;j++)
		{
			if(j == startYear)
			{
				if((startYear % 4 == 0 && startYear % 100 != 0)||(startYear % 400 == 0))
					Year[1] = 29;
				else Year[1] = 28;
				for (i = startMonth-1;i < 12;i++)
				{
					if (i == startMonth-1)
						num = num + Year[i] - startDay;
					else num = num + Year[i];
				}
			}
			else if (j == endYear)
			{
				if((endYear % 4 == 0 && endYear % 100 != 0)||(endYear % 400 == 0))
					Year[1] = 29;
				else Year[1] = 28;
				for (i = 0;i < endMonth;i++)
				{
					if (i == endMonth - 1)
						num = num + endDay;
					else num = num + Year[i];
				}
			}
			else
			{
				if((j % 4 == 0 && j % 100 != 0)||(j % 400 == 0))
					Year[1] = 29;
				else Year[1] = 28;
				for (i = 0;i < 12;i++)
					num = num + Year[i];
			}
	    }
	}
	cout << num <<endl;
	return 0;
}


int year[3001]={0};
int remain(int y,int m,int d);
int main()
{
	int i,sum=0,year1,mon1,day1,year2,mon2,day2;
	cin>>year1>>mon1>>day1>>year2>>mon2>>day2;
	for(i=1;i<=3000;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
			year[i]=366;
		else
			year[i]=365;
	}
	if(year1<year2)
	{
		for(i=year1+1;i<year2;i++)
			sum+=year[i];
		sum+=remain(year1,mon1,day1)+year[year2]-remain(year2,mon2,day2);
	}
	else if(year1==year2)
	{
		sum+=remain(year1,mon1,day1)-remain(year2,mon2,day2);
	}
	cout<<sum<<endl;
	return 0;
}

int remain(int y,int m,int d)
{
	int k=0,i,month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	if(year[y]==365)
	{
		k+=month[m]-d;
		for(i=m+1;i<=12;i++)
			k+=month[i];
	}
	else
	{
		month[2]=29;
		k+=month[m]-d;
		for(i=m+1;i<=12;i++)
			k+=month[i];
	}
	return k;
}


int main()
{int startYear,startMonth,startDay,endYear,endMonth,endDay,i,s=0,a=0;
scanf("%d %d %d\n",&startYear,&startMonth,&startDay);
scanf("%d %d %d",&endYear,&endMonth,&endDay);
for(i=startYear+1;i<endYear;i++){
 if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
  s=s+1;
 else
  s=s+0;
 }
s=s+(endYear-startYear-1)*365;
if(endMonth>2&&endMonth<=8){
 for(i=1;i<endMonth;i++){
  if(i%2==1)
   s=s+31;
  else if(i%2==0&&i!=2)
   s=s+30;
  else if(i==2){
   if((endYear % 4 == 0 &&endYear % 100 != 0) || (endYear % 400 == 0))
     s=s+29;
   else
     s=s+28;
   }
  }
 }
else if(endMonth>8){
 if((endYear % 4 == 0 &&endYear % 100 != 0) || (endYear % 400 == 0))
     s=s+29+4*31+2*30;
 else
     s=s+28+4*31+2*30;
 for(i=8;i<endMonth;i++){
  if(i%2==1)
   s=s+30;
  else if(i%2==0&&i!=2)
   s=s+31;
  }
 }
else if(endMonth==1)
 s=s+0;
else if(endMonth==2)
 s=s+31;
s=s+endDay;
if(startMonth>2&&startMonth<=8){
 for(i=1;i<startMonth;i++){
  if(i%2==1)
   a=a+31;
  else if(i%2==0&&i!=2)
   a=a+30;
  else if(i==2){
   if((startYear % 4 == 0 &&startYear % 100 != 0) || (startYear % 400 == 0))
     a=a+29;
   else
     a=a+28;
   }
  }
 }
else if(startMonth>8){
 if((endYear % 4 == 0 &&endYear % 100 != 0) || (endYear % 400 == 0))
     a=a+29+4*31+2*30;
 else
     a=a+28+4*31+2*30;
 for(i=8;i<startMonth;i++){
  if(i%2==1)
   a=a+30;
  else if(i%2==0&&i!=2)
   a=a+31;
  }
 }
else if(startMonth==1)
 a=a+0;
else if(startMonth==2)
 a=a+31;
a=a+startDay;
if((startYear % 4 == 0 &&startYear % 100 != 0) || (startYear % 400 == 0))
 s=s+366-a;
else
 s=s+365-a;
printf("%d",s);
return 0;
}


int dijitian(int,int,int);
int isrunnian(int);

int main(int argc, char* argv[])
{
    int year1,year2,month1,month2,day1,day2;
	int sum=0,i;

	scanf("%d%d%d",&year1,&month1,&day1);
	scanf("%d%d%d",&year2,&month2,&day2);

	if(year1!=year2){
		if(isrunnian(year1)==1){
			sum=366-dijitian(year1,month1,day1);
		}else{
			sum=365-dijitian(year1,month1,day1);
		}

		for(i=year1+1;i<year2;i++){
			if(isrunnian(i)==1){
				sum+=366;
			}else{
				sum+=365;
			}
		}
		sum+=dijitian(year2,month2,day2);
	}else{
		sum=dijitian(year2,month2,day2)-dijitian(year1,month1,day1);
	}

	printf("%d",sum);

	return 0;
}

int dijitian(int year,int month,int day){

	int sum=0,i;

	for(i=1;i<month;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			sum+=31;
		}
		if(i==4||i==6||i==9||i==11){
			sum+=30;
		}
		if(i==2){
			if(isrunnian(year)==1){
				sum+=29;
			}else{
				sum+=28;
			}
		}
	}

	sum+=day;

	return sum;

}

int isrunnian(int year){
	if((year%400==0)||(year%100!=0&&year%4==0)){
		return 1;
	}else{
		return 0;
	}
}


int monthday[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int leap(int year)
{
	if((year % 4 == 0 && year % 100 != 0)|| year % 400 == 0)
		return 1;
	else
		return 0;
}

int main()
{
	int month, year, year1, year2, month1, month2, day1, day2, day = 0;
	cin >> year1 >> month1 >> day1;
	cin >> year2 >> month2 >> day2;
	for(year = year1 + 1; year <= year2 -1; year++)
	{
		day += 365 + leap(year);
	}
	if(year1 < year2)
	{
		for(month = 1; month < month2; month++)
				day += monthday[month];
		day += day2;
		if(leap(year2) && month2 >= 3)
			day++;
		for(month = month1; month <= 12; month++)
			day+= monthday[month];
		day -= day1;
		if(leap(year1) && month1 < 3)
			day++;
	}
	else
	{
		if(month1 != month2)
		for(month = month1; month < month2; month++)
		{

			{
				day += monthday[month];
				day += day2;
				day -= day1;
				if(leap(year1) && month1 < 3)
					day++;
			}

		}
		else
				day = day2 - day1;
	}
	cout << day << endl;
	return 0;
}


int main()
{
    int i,j,k,days1=0,days2=0;
    int days=0,leap_year=0,startYear,startMonth,startDay,endYear,endMonth,endDay;
    int year[2]={365,366},month[24]={31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31,30,31};
    cin >> startYear >> startMonth >> startDay;
    cin >> endYear >> endMonth >> endDay;
    if(startYear==endYear)
    {
      if((startYear % 4 == 0 && startYear %100 != 0 )||( startYear % 400 == 0))
      {
       for(i=0;i<startMonth-1;i++)
       {days1 = days1+month[12+i];}
       days1 = days1+startDay;
       for(j=0;j<endMonth-1;j++)
       {days2=days2+month[12+j];}
       days2 =days2+endDay;
       days= days2-days1;
       cout << days << endl;
      }
     else
      {
       for(i=0;i<startMonth-1;i++)
       {days1=days1+month[i];}
       days1=days1+startDay;
       for(j=0;j<endMonth-1;j++)
       {days2=days2+month[j];}
       days2=days2+endDay;
       days= days2-days1;
       cout << days << endl;
      }
    }
   if(startYear!=endYear)
   {
     k=startYear;
     while(k<endYear)
     {leap_year=((k%4==0&&k%100!=0) ||(k%400==0));
     days=days+year[leap_year];
     k++;
     }
     if((startYear % 4 == 0 && startYear %100 != 0 )||( startYear % 400 == 0))
      {
       for(i=0;i<startMonth-1;i++)
       {days1=days1+month[12+i];}
       days1=days1+startDay;
      }
     else
      {
      for(i=0;i<startMonth-1;i++)
       {days1=days1+month[i];}
       days1=days1+startDay;
      }
       days=days-days1;
      if((endYear % 4 == 0 && endYear %100 != 0 )||( endYear % 400 == 0))
       {
       for(i=0;i<endMonth-1;i++)
       {days2=days2+month[12+i];}
       days2=days2+endDay;
       }
      else
      {
       for(i=0;i<endMonth-1;i++)
       {days2=days2+month[i];}
        days2=days2+endDay;
      }
       days=days+days2;
       cout << days << endl;
    }

    return 0;
}


int judgeyear(int year)
{
	if (year%4!=0||year%100==0&&year%400!=0)
		return 0;
	else
		return 1;
}

int main ()
{
    int year1,month1,day1;
	int year2,month2,day2;
	cin>>year1>>month1>>day1>>year2>>month2>>day2;
	int montha[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int monthb[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int sum=0;
	for (int i=year1+1;i<year2;i++)
	{
		sum+=365+judgeyear(i);

	}
	if (year1<year2)
	{
		for (int i=month1+1;i<=12;i++)
		{
			if (judgeyear(year1))
				sum+=monthb[i];
			else
				sum+=montha[i];

		}
		for (int i=1;i<month2;i++)
		{
			if (judgeyear(year2))
				sum+=monthb[i];
			else
				sum+=montha[i];

		}
	}
	else
	{
		for (int i=month1+1;i<month2;i++)
		{
			if (judgeyear(year1))
				sum+=monthb[i];
			else
				sum+=montha[i];
		}
	}
	if (year1==year2&&month1==month2)
	{sum+=day2-day1;}
	else
	{
		if (judgeyear(year1))
			sum+=monthb[month1]-day1;
		else
			sum+=montha[month1]-day1;
		sum+=day2;

	}
		cout<<sum<<endl;

	return 0;
}


int main()
{
	int sy, sm, sd, ey, em, ed, n;
	int year(int y);
	int mouth(int m, int y);
	int day(int d);
	scanf("%d%d%d%d%d%d", &sy, &sm, &sd, &ey, &em, &ed);
	n=year(ey)+mouth(em, ey)+day(ed)-year(sy)-mouth(sm, sy)-day(sd);
    printf("%d\n", n);
	return 0;
}

int year(int y)
{
	int i, sum=0;
	for(i=1000;i<y;i++)
	{
		if((i%4==0 && i%100!=0) || (i%400==0))
        sum=sum+366;
		else sum=sum+365;
	}
	return(sum);
}

int mouth(int m, int y)
{
	int i, sum=0;
	if((y%4==0 && y%100!=0) || (y%400==0))
	{
		for(i=1;i<m;i++)
		{
			if(i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12)
				sum=sum+31;
			else if(i==2)
				sum=sum+29;
			else sum=sum+30;
		}
	}
	else
	{
		for(i=1;i<m;i++)
		{
			if(i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12)
				sum=sum+31;
			else if(i==2)
				sum=sum+28;
			else sum=sum+30;
		}
	}
	return(sum);
}

int day(int d)
{
	return(d-1);
}


/*
 * dates.cpp
 *
 *  Created on: 2011-11-4
 *      Author: admin
 */
int main(){
int startYear,startMonth,startDay,endYear,endMonth,endDay,i,day1=0,day2=0,day3=0;
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int b[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
cin>>startYear>>startMonth>>startDay>>endYear>>endMonth>>endDay;
if((startYear%4==0)&&(startYear%100!=0)||(startYear%400==0)){
	for (i=1;i<=startMonth-1;i++){
		day1=b[i]+day1;
	}
	day1=day1+startDay;
}
else {
	for (i=1;i<=startMonth-1;i++){
    day1=a[i]+day1;
	}
    day1=day1+startDay;
}
if((endYear%4==0)&&(endYear%100!=0)||(endYear%400==0)){
	for (i=1;i<=endMonth-1;i++){
		day2=b[i]+day2;
	}
	day2=day2+endDay;
}
else{
	for (i=1;i<=endMonth-1;i++){
		day2=a[i]+day2;
	}
	day2=day2+endDay;
}
for (i=startYear;i<=endYear-1;i++){
	if((i%4==0)&&(i%100!=0)||(i%400==0))day3=day3+366;
	else day3=day3+365;
}
cout<<day3+day2-day1;
return 0;
}


int main()
{
	int i,t;
	int startyear,startMonth,startDay;
	int endyear,endMonth,endDay;
	int day,a,b,m=0,n=0;
	scanf("%d%d%d",&startyear,&startMonth,&startDay);
	scanf("%d%d%d",&endyear,&endMonth,&endDay);
    if((startyear%4==0 && startyear%100!=0) || (startyear%400==0))
	{
		switch(startMonth)
		{
		case 1:a=startDay-32;
			break;
		case 2:a=startDay-1;
			break;
		case 3:a=28+startDay;
			break;
		case 4:a=59+startDay;
			break;
		case 5:a=89+startDay;
			break;
		case 6:a=120+startDay;
			break;
		case 7:a=150+startDay;
			break;
		case 8:a=181+startDay;
			break;
		case 9:a=212+startDay;
			break;
		case 10:a=242+startDay;
			break;
		case 11:a=273+startDay;
			break;
		case 12:a=303+startDay;
			break;
		}
	}
		else
		{
	    switch(startMonth)
		{
		case 1:a=startDay-32;
			break;
		case 2:a=startDay-1;
			break;
		case 3:a=28+startDay-1;
			break;
		case 4:a=59+startDay-1;
			break;
		case 5:a=89+startDay-1;
			break;
		case 6:a=120+startDay-1;
			break;
		case 7:a=150+startDay-1;
			break;
		case 8:a=181+startDay-1;
			break;
		case 9:a=212+startDay-1;
			break;
		case 10:a=242+startDay-1;
			break;
		case 11:a=273+startDay-1;
			break;
		case 12:a=303+startDay-1;
			break;
		}
		}
	 if((endyear%4==0 && endyear%100!=0) || (endyear%400==0))
	{
		switch(endMonth)
		{
		case 1:b=endDay-32;
			break;
		case 2:b=endDay-1;
			break;
		case 3:b=28+endDay;
			break;
		case 4:b=59+endDay;
			break;
		case 5:b=89+endDay;
			break;
		case 6:b=120+endDay;
			break;
		case 7:b=150+endDay;
			break;
		case 8:b=181+endDay;
			break;
		case 9:b=212+endDay;
			break;
		case 10:b=242+endDay;
			break;
		case 11:b=273+endDay;
			break;
		case 12:b=303+endDay;
			break;
		}
	 }
		else
		{
	    switch(endMonth)
		{
		case 1:b=endDay-32;
			break;
		case 2:b=endDay-1;
			break;
		case 3:b=28+endDay-1;
			break;
		case 4:b=59+endDay-1;
			break;
		case 5:b=89+endDay-1;
			break;
		case 6:b=120+endDay-1;
			break;
		case 7:b=150+endDay-1;
			break;
		case 8:b=181+endDay-1;
			break;
		case 9:b=212+endDay-1;
			break;
		case 10:b=242+endDay-1;
			break;
		case 11:b=273+endDay-1;
			break;
		case 12:b=303+endDay-1;
			break;
		}
		}
		if(startyear>endyear)
		{
			t=endyear;
			endyear=startyear;
			startyear=t;
		}
		for(i=startyear;i<endyear;i++)
		{
			if((i%4==0 && i%100!=0) || (i%400==0))
				m=m+1;
		}
        if(startyear==endyear)
			n=0,m=0;
		else
		n=endyear-startyear-m;
		day=(366*m+365*n-a+b);
		printf("%d",day);
		return 0;
		}


int main()
{
	int a[3],b[3];
	int i,da=0,d=0;

	for(i=0;i<=2;i++)
		scanf("%d",&a[i]);

	for(i=0;i<=2;i++)
		scanf("%d",&b[i]);

    int leap (int year);

	for(a[1]--;a[1]>=1;a[1]--)
	{
		switch(a[1])
		{
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:

		case 12:da=da+31;break;
		case 4:
		case 6:
		case 9:
		case 11:da=da+30;break;

		case 2:
			{
				if(leap(a[0])) da=da+29;
				else da=da+28;
			}
		}
	}

	da=da+a[2];//A??????

		for(b[1]--;b[1]>=1;b[1]--)
		{

		switch(b[1])
		{
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:

		case 12:d=d+31;break;
		case 4:
		case 6:
		case 9:
		case 11:d=d+30;break;

		case 2:
			{
				if(leap(b[0])) d=d+29;
				else d=d+28;
			}
		}
		}
    d=d+b[2];//B??????

	for(;a[0]<b[0];a[0]++)//???????
	{
			if(leap(a[0]))
				d=d+366;
			else d=d+365;
	}
	printf("%d\n",d-da);
	return 0;
}

int leap (int year)//LEAP YEAR OR NOT
	{
        int LEAP;
		if(year%4==0&&year%100!=0||year%400==0)
           LEAP=1;
		else LEAP=0;
		return LEAP;
	}


int main ()
{
	int y1,y2,m1,m2,d1,d2,i,j,sum=0,k,m,year;
	cin >>y1>>m1>>d1;
	cin >>y2>>m2>>d2;
	if (y1<y2)
	{
		for (i=y1+1;i<y2;i++)
		{
			if ((i % 4 == 0 && i% 100 != 0) || (i % 400 == 0))
				sum+=366;
			else sum+=365;
		}
		year=y1;
		for (i=m1+1;i<=12;i++)
		{
			switch (i)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12: m=31;break;
				case 2:  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
							 m=29;
						 else m=28;
						 break;
				case 4:
				case 6:
				case 9:
				case 11: m=30;break;
			}
			sum+=m;
		}
		switch (m1)
		{
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12: m=31;break;
			case 2:  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
							m=29;
						else m=28;
						break;
			case 4:
			case 6:
			case 9:
			case 11: m=30;break;
		}
		sum +=m-d1;
		year =y2;
		for (i=1;i<m2;i++)
		{
			switch (i)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12: m=31;break;
				case 2:  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
							 m=29;
						 else m=28;
						 break;
				case 4:
				case 6:
				case 9:
				case 11: m=30;break;
			}
			sum+=m;
		}
		sum+=d2;
	}
	if (y1==y2)
	{
		if (m1<m2)
		{
			for (i=m1;i<m2;i++)
			{
				switch (i)
				{
					case 1:
					case 3:
					case 5:
					case 7:
					case 8:
					case 10:
					case 12: m=31;break;
					case 2:  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
								 m=29;
							 else m=28;
							 break;
					case 4:
					case 6:
					case 9:
					case 11: m=30;break;
				}
				sum+=m;
			}
			sum+=d2;
			switch (m1)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12: m=31;break;
				case 2:  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
								m=29;
							else m=28;
							break;
				case 4:
				case 6:
				case 9:
				case 11: m=30;break;
			}
			sum+=m-d1;
		}
		if (m1==m2)
			sum=d2-d1;
	}
	cout <<sum<<endl;

	return 0;
}


// jisuanlianggeriqijiandetianshu.cpp : Defines the entry point for the console application.
//

int main()
{
	int yearr[13] = {0, 31,29,31,30,31,30,31,31,30,31,30,31};
	int yearp[13] = {0, 31,28,31,30,31,30,31,31,30,31,30,31};

	int sty = 0;
	int stm = 0;
	int str = 0;

	int eny = 0;
	int enm = 0;
	int enr = 0;

	int i = 0;
	int t = 0;
	int j = 0;

	int day = 0;
	int year = 0;
	int mon = 0;

	cin >> sty;
	cin >> stm;
	cin >> str;
	cin >> eny;
	cin >> enm;
	cin >> enr;

	for( i = 0;i <= eny - sty;i++ )
	{
		year = sty + i;

		if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) )
		{
			if( year == sty && year != eny)
			{
				for( t = stm;t <= 12;t++ )
				{
					if( t == stm)
						day += yearr[t] - str;
					else
						day += yearr[t];
				}
			}
			if( year == eny && year != sty )
			{
				for( t =1;t <= enm;t++)
				{
					if( t== enm)
						day += enr;
					else
						day += yearr[t];
				}
			}

			if( year != eny && year!= sty )
			{
				for( t =1;t <= 12;t++ )
					day += yearr[t];
			}
			if( year == eny && year == sty )
			{
				if( stm == enm )
					day += enr - str;
				else
				{
					for( t = stm;t <= enm;t++ )
					{
						if( t == stm )
							day += yearr[t] - str;
						else if( t == enm )
						{
							day += enr;
						}
						else if( t!= stm && t!= enm )
							day += yearr[t];
					}
				}
			}
		}
		else
		{
			if( year == sty && year != eny)
			{
				for( t = stm;t <= 12;t++ )
				{
					if( t == stm)
						day += yearp[t] - str;
					else
						day += yearp[t];
				}
			}
			if( year == eny && year != sty )
			{
				for( t =1;t <= enm;t++)
				{
					if( t== enm)
						day += enr;
					else
						day += yearp[t];
				}
			}

			if( year != eny && year!= sty )
			{
				for( t =1;t <= 12;t++ )
					day += yearp[t];
			}
			if( year == eny && year == sty )
			{
				if( stm == enm )
					day += enr - str;
				else
				{
					for( t = stm;t <= enm;t++ )
					{
						if( t == stm )
							day += yearp[t] - str;
						else if( t == enm )
						{
							day += enr;
						}
						else if( t!= stm && t!= enm )
							day += yearp[t];
					}
				}
			}

		}
	}

	cout << day;

	cin >> i;

	return 0;
}


int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int leapdays[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int leapyearornot(int year)
{
	return year % 400==0||year%4==0&&year%100!=0;
}
int sumfromfirstday(int year,int month,int day)
{
	int i,sum=day;
	for(i=1;i<month;i++)
	{
		if(leapyearornot(year))
			sum+=leapdays[i];
		else
			sum+=days[i];
	}
	return sum;
}

int daysfromfirst(int startyear,int endyear,int endmonth,int endday)
{
	int i,sum=0;
	for(i=startyear;i<endyear;i++)
	{
		sum+=leapyearornot(i)?366:365;
	}
	sum+=sumfromfirstday(endyear,endmonth,endday);
	return sum;
}

int main()
{
	int startyear,startmonth,startday,endyear,endmonth,endday;
	scanf("%d %d %d %d %d %d",&startyear,&startmonth,&startday,&endyear,&endmonth,&endday);
	printf("%d",daysfromfirst(startyear,endyear,endmonth,endday)-daysfromfirst(startyear,startyear,startmonth,startday));
	return 0;
}


int main()
{
	int sy, sm, sd,ey, em,ed,i,num = 0, k;
	cin >> sy >> sm >> sd >> ey >> em >> ed;
	if (sm <= 2)
	{
			for (i = sy; i < ey;i ++)
			{
				num+=365;
				if( (i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
					++num;
			}
			if (sm ==2 && sd == 29) --num;
	}
	else
	{
			for (i = sy + 1; i <= ey;i ++)
			{
				num+=365;
				if( (i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
					++num;
			}
	}
	if (em > sm)
	{
		num = num + (em - sm) *30;
		for (i = sm; i < em;i++)
		{
			switch(i)
			{
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12: ++num; break;
			case 2:
				{
					if ((ey % 4 == 0 && ey % 100 != 0) || (ey % 400 == 0))
					num = num - 1;
					else
						num = num - 2;
					break;
				}
			default: break;
			}
		}
		num = num + ed - sd;
	}
	else
	{
		k= (sm - em) * 30;
		for (i = em; i < sm;i++)
		{
			switch(i)
			{
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12: ++k; break;
			case 2:
				{
					if ((ey % 4 == 0 && ey % 100 != 0) || (ey % 400 == 0))
					k = k - 1;
					else
						k = k - 2;
					break;
				}
			default: break;
			}
		}
		k = sd - ed + k;
		num = num - k;
	}
	cout << num << endl;
	return 0;
}


int main()
{
	int a[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int startyear,endyear,startmonth,endmonth,startday,endday,days,days2,temp1,temp2,flag1,flag2;
	int year , month;
	cin >> startyear >> startmonth >> startday;
	cin >> endyear >> endmonth >> endday;
	if(startyear == endyear)
	{
		days = 0;
		if(startyear % 4 == 0 && startyear % 100 != 0 || startyear % 400 == 0)
			a[1] = 29;
		else
			a[1] = 28;
		for(month = startmonth ; month < endmonth ; month++)
			days = days + a[month - 1];
		days = days + endday - startday;
		cout << days << endl;
	}
	else if(startyear < endyear)
	{
		days = 0;
		days2= 0;
		for(year = startyear ; year < endyear ; year++)
		{
			if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
				days = days + 366;
			else
				days = days + 365;
		}
		flag1 = startmonth;
		flag2 = endmonth;
		if(startmonth > endmonth)
		{
			temp1 = startmonth;
			temp2 = startday;
			startmonth = endmonth;
			startday = endday;
			endmonth = temp1;
			endday = temp2;
		}
		if(endyear % 4 == 0 && endyear % 100 != 0 || endyear % 400 == 0)
			a[1] = 29;
		else
			a[1] = 28;
		for(month = startmonth ; month < endmonth ; month++)
			days2 = days2 + a[month - 1];
		days2 = days2 + endday - startday;
		if(flag1 > flag2)
			cout << days - days2 << endl;
		else
			cout << days + days2 << endl;
	}
	return 0;
}


int main()
{
	int GongJiTian(int, int, int);
	int year1, month1, day1, year2, month2, day2;
	scanf("%d %d %d", &year1, &month1, &day1);
	scanf("%d %d %d", &year2, &month2, &day2);
	int result, a, b;
	a=GongJiTian(year1,month1,day1);
	b=GongJiTian(year2,month2,day2);
	if(a>b){
		result=a-b;
	}else{
		result=b-a;
	}
	printf("%d", result);
	return 0;
}

int DiJiTian(int year, int month, int day){
	int isRunNian(int);
	int result=0;
	int i;
	for(i=1;i<month;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			result+=31;
		}else if(i==4||i==6||i==9||i==11){
			result+=30;
		}else if(i==2){
			if(isRunNian(year)){
				result+=29;
			}else{
				result+=28;
			}
		}
	}
	result+=day;
	return result;
}

int isRunNian(int year){
	int result;
	if(year%400==0||((year%4==0)&&(year%100!=0))){
		result=1;
	}else{
		result=0;
	}
	return result;
}

int GongJiTian(int year, int month, int day){
	int DiJiTian(int, int, int);
	int result=0;
	int i;
	for(i=1;i<year;i++){
		if(isRunNian(i)){
			result+=366;
		}else{
			result+=365;
		}
	}
	result+=DiJiTian(year, month, day);
	return result;
}


int main()
{
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31},
	    b[12]={31,29,31,30,31,30,31,31,30,31,30,31},
	    startYear,startMonth,startDay,endYear,endMonth,endDay;
	scanf("%d%d%d%d%d%d",&startYear,&startMonth,&startDay,&endYear,&endMonth,&endDay);
	int i,sum=0,sum1=0,sum2=0;
     for (i=startYear;i<endYear;i++)
     { if( (i% 4 == 0 && i % 100 != 0) || (i % 400 == 0))
    	 sum=sum+366;
     else
    	 sum=sum+365;
     }
     if ((startYear% 4 == 0 && startYear% 100 != 0) || (startYear % 400 == 0))
     {

    	 for (i=0;i<(startMonth-1);i++)
    		 sum1=sum1+b[i];
     }
     else
     {

    	    	 for (i=0;i<(startMonth-1);i++)
    	    		 sum1=sum1+a[i];
     }
     if ((endYear% 4 == 0 && endYear% 100 != 0) || (endYear % 400 == 0))
          {

         	 for (i=0;i<(endMonth-1);i++)
         		 sum2=sum2+b[i];
          }
     else
             {

            	 for (i=0;i<(endMonth-1);i++)
            		 sum2=sum2+a[i];
             }
     int m;
     m=sum-sum1-startDay+sum2+endDay;
     printf("%d\n",m);
}


int DiJiTian(int year,int month,int day);
int isRunNian(int year);
int main(){
	int year1,month1,day1;
	int year2,month2,day2;
	int zongyear;
	int zongday;
	int xiangchaday;
	int x,y;
	int i;
	int e,f,g;
	scanf("%d%d%d%d%d%d",&year1,&month1,&day1,&year2,&month2,&day2);
	if(year1>year2){
		e=year1;
		year1=year2;
		year2=e;
		f=month1;
		month1=month2;
		month2=f;
		g=day1;
		day1=day2;
		day2=g;
	}
	x=DiJiTian(year1,month1,day1);
	y=DiJiTian(year2,month2,day2);
	zongyear=year2-year1;
	zongday=zongyear*365;
	for(i=year1;i<year2;i++){
		if((i%100!=0&&i%4==0)||i%400==0){
			zongday+=1;
		}
	}
	xiangchaday=zongday+y-x;
	printf("%d",xiangchaday);
	return 0;
}
int DiJiTian(int year, int month, int day){
	int result = 0;
	for(int j = 1; j < month; j++){
		if(j==1||j==3||j==5||j==7||j==8||j==10||j==12){
			result += 31;
		} else if (j == 4 || j ==6 || j == 9 || j==11){
			result += 30;
		} else if(j == 2){
			if(isRunNian(year)){
				result += 29;
			} else {
				result += 28;
			}
		}
	}
	result += day;
	return result;
}
int isRunNian(int year){
	int result;
	if(year%400 == 0 ||(year%4==0 && year%100!=0)){
		result = 1;
	} else{
		result = 0;
	}
      return result;
}


int mon[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int spec_year(int);
int main()
{

	void scan(int *year,int *month,int *day);
	long com_year(int y1,int y2);
	int com_month(int y1,int m1,int y2,int m2);
	int com_day(int y1,int m1,int d1,int y2,int m2,int d2);

	int year1,month1,day1;
	int year2,month2,day2;

	long sum=0;
	int k=0;

	scanf("%d %d %d",&year1,&month1,&day1);
	scanf("%d %d %d",&year2,&month2,&day2);

	sum+=com_year(year1,year2);
	sum+=com_month(year1,month1,year2,month2);
	sum+=com_day(year1,month1,day1,year2,month2,day2);

	printf("%d",sum);

	return 0;
}
long com_year(int y1,int y2)/*???????????*/
{
	int i;
	long sum=0;
	for(i=y1+1;i<y2;i++)
	{
		if(spec_year(i))
			sum+=366;
		else
			sum+=365;
	}
	return sum;
}
int com_month(int y1,int m1,int y2,int m2)/*???????????*/
{
	int i;
	int sum=0;
	if(y1!=y2)
	{
		if(spec_year(y1))
		{
			mon[1]=29;
		}
		if(m1!=m2)
		{
			for(i=m1;i<12;i++)
			{
				sum+=mon[i];
			}
			mon[1]=28;

			if(spec_year(y2))
			{
				mon[1]=29;
			}

			for(i=0;i<m2-1;i++)
			{
				sum+=mon[i];
			}
			mon[1]=28;
		}
		else
		{
			for(i=m1-1;i<12;i++)
			{
				sum+=mon[i];
			}
			mon[1]=28;

			if(spec_year(y2))
			{
				mon[1]=29;
			}

			for(i=0;i<m2-1;i++)
			{
				sum+=mon[i];
			}
			mon[1]=28;
		}
	}
	else
	{
		if(spec_year(y1))
		{
			mon[1]=29;
		}
		for(i=m1;i<m2-1;i++)
		{
			sum+=mon[i];
		}
			mon[1]=28;
	}
	return sum;
}

int com_day(int y1,int m1,int d1,int y2,int m2,int d2)             /*?????????*/
{
	int sum=0;

	if(m1!=m2)
	{
		if(spec_year(y1))
		{
			mon[1]=29;
		}

		sum+=(mon[m1-1]-d1);

		sum+=d2;

		mon[1]=28;
	}
	else
	{
		sum+=d2-d1;

	}

	return sum;
}
int spec_year(int year) /*???????*/
{
	if((year%400==0)||((year%4==0)&&(year%100!=0)))
		return 1;
	else
		return 0;
}


int months1[12]={31,28,31,30,31,30,31,31,30,31,30,31},
	months2[12]={31,29,31,30,31,30,31,31,30,31,30,31};		//months1?????months2????
int check (int year);

int main()
{
	int year1,year2,month1,month2,day1,day2;
	int i,x=0,sum=0;
	cin>>year1>>month1>>day1>>year2>>month2>>day2;			//??????
	for (i=year1+1;i<year2;i++)
	{
		x=check(i);
		if (x==0)											//?????
			sum=sum+365;
		else if (x==1)										//?????
			sum=sum+366;
	}
	if (year1!=year2)
	{
		if (check(year1))										//year1???
		{
			for (i=month1+1;i<=12;i++)
				sum=sum+months2[i-1];
			sum=sum+months2[month1-1]-day1;
		}
		else													//year1???
		{
			for (i=month1+1;i<=12;i++)
				sum=sum+months1[i-1];
			sum=sum+months1[month1-1]-day1;
		}
		if (check(year2))										//year2???
		{
			for (i=1;i<month2;i++)
				sum=sum+months2[i-1];
			sum=sum+day2;
		}
		else													//year2???
		{
			for (i=1;i<month2;i++)
				sum=sum+months1[i-1];
			sum=sum+day2;
		}
	}
	else
	{
		if (check(year1))										//year1???
		{
			for (i=month1+1;i<month2;i++)
				sum=sum+months2[i-1];
			if (month1!=month2)
				sum=sum+months2[month1-1]-day1+day2;
			else
				sum=day2-day1;
		}
		else													//year1???
		{
			for (i=month1+1;i<month2;i++)
				sum=sum+months1[i-1];
			if (month1!=month2)
				sum=sum+months1[month1-1]-day1+day2;
			else
				sum=day2-day1;
		}
	}
	cout<<sum<<endl;
	return 0;
}

int check (int year)										//?????????????
{
	if (((year%4==0)&&(year%100!=0))||(year%400==0))
		return 1;
	else
		return 0;
}


int main()
{
    int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int i,j,k,sum,startyear,startmonth,startday,endyear,endmonth,endday;
    scanf("%d %d %d",&startyear,&startmonth,&startday);
    scanf("%d %d %d",&endyear,&endmonth,&endday);
    sum=0;
    if ( (startyear%4==0&&startyear%100!=0)||(startyear%400==0)){
         month[1]=29;
         }
    for (i=startyear+1;i<endyear;i++){
        if ( (i%4==0&&i%100!=0)||(i%400==0)){
             sum=sum+366;
             }
        else sum=sum+365;
        }
    if (startyear==endyear){
         if ( startmonth==endmonth){
              sum=endday-startday;
              }
         else {
              for (i=startday+1;i<=month[startmonth-1];i++){
                  sum=sum+1;
                  }
              for (i=startmonth+1;i<endmonth;i++){
                  sum=sum+month[i-1];
                  }
              for (i=1;i<=endday;i++){
                  sum=sum+1;
                  }
              }
         }
    else {
         for (i=startday+1;i<=month[startmonth-1];i++){
                  sum=sum+1;
                  }
         for (i=startmonth+1;i<=12;i++){
                  sum=sum+month[i-1];
                  }
         if ((endyear%4==0&&endyear%100!=0)||(endyear%400==0)){
             month[1]=29;
             }
         else month[i]=28;
         for (i=1;i<endmonth;i++){
             sum=sum+month[i-1];
             }
         for (i=1;i<=endday;i++){
             sum=sum+1;
             }
         }
    printf("%d",sum);
    return 0;
}


void main()
{
	int year1,year2,month1,month2,day1,day2,s1=0,s2=0,s3=0;
	scanf("%d %d %d\n",&year1,&month1,&day1);
	scanf("%d %d %d",&year2,&month2,&day2);
	int num(int year,int month,int day);
	int laf(int a,int b);
	s1=num(year1,month1,day1);
	s2=num(year2,month2,day2);
	s3=laf(year1,year2);
	printf("%d\n",s3+s2-s1);
}
int num(int year,int month,int day)
{
	int z;
	int sum1(int a,int b);
	int sum2(int a,int b);
	if((year%400==0)||((year%100!=0)&&(year%4==0)))
	   z=sum1(month,day);
    else z=sum2(month,day);
    return(z);
}
int sum1(int a,int b)
{
	int z=0;
	switch(a)
	{
		case 1:z=b;break;
		case 2:z=31+b;break;
		case 3:z=60+b;break;
		case 4:z=91+b;break;
		case 5:z=121+b;break;
		case 6:z=152+b;break;
		case 7:z=182+b;break;
		case 8:z=213+b;break;
		case 9:z=244+b;break;
		case 10:z=274+b;break;
		case 11:z=305+b;break;
		case 12:z=335+b;
	}
	return(z);
}
int sum2(int a,int b)
{
	int z=0;
	switch(a)
	{
		case 1:z=b;break;
		case 2:z=31+b;break;
		case 3:z=59+b;break;
		case 4:z=90+b;break;
		case 5:z=120+b;break;
		case 6:z=151+b;break;
		case 7:z=181+b;break;
		case 8:z=212+b;break;
		case 9:z=243+b;break;
		case 10:z=273+b;break;
		case 11:z=304+b;break;
		case 12:z=334+b;
	}
	return(z);
}
int laf(int a,int b)
{
	int z=0,i;
	for(i=a;i<b;i++)
      {if((i%400==0)||((i%100!=0)&&(i%4==0)))
         z=z+366;
      else z=z+365;}
    return(z);
}


int main()
{
	int startYear, startMonth, startDay;
	int endYear, endMonth, endDay;
	int i, days = 0;
	cin >> startYear >> startMonth >> startDay;
	cin >> endYear >> endMonth >> endDay;
	for (i = startYear; i < endYear; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			days += 366;
		else
			days += 365;
	}
	for (i = 1; i < endMonth; i++)
	{
		switch (i)
		{
		case 1:	;
		case 3:	;
		case 5:	;
		case 7:	;
		case 8:	;
		case 10:	;
		case 12:	days += 31;	break;
		case 2:
			{
				if ((endYear % 4 == 0 && endYear % 100 != 0) || (endYear % 400 == 0))
				{
					days += 29;
					break;
				}
				else
				{
					days += 28;
					break;
				}
			}
		default :	days += 30;	break;
		}
	}
	days += endDay;
	for (i = 1; i < startMonth; i++)
	{
		switch (i)
		{
		case 1:	;
		case 3:	;
		case 5:	;
		case 7:	;
		case 8:	;
		case 10:	;
		case 12:	days -= 31;	break;
		case 2:
			{
				if ((startYear % 4 == 0 && startYear % 100 != 0) || (startYear % 400 == 0))
				{
					days -= 29;
					break;
				}
				else
				{
					days -= 28;
					break;
				}
			}
		default :	days -= 30;	break;
		}
	}
	days -= startDay;
	cout << days << endl;
	return 0;
}


int main()
{
	int startyear,startmonth,startday,endyear,endmonth,endday;
	int total,i,j;
	int A[12],B[12];
	A[0]=31;
	A[1]=28;
	A[2]=31;
	A[3]=30;
	A[4]=31;
	A[5]=30;
	A[6]=31;
	A[7]=31;
	A[8]=30;
	A[9]=31;
	A[10]=30;
	A[11]=31;

    B[0]=31;
	B[1]=29;
	B[2]=31;
	B[3]=30;
	B[4]=31;
	B[5]=30;
	B[6]=31;
	B[7]=31;
	B[8]=30;
	B[9]=31;
	B[10]=30;
	B[11]=31;

	scanf("%d%d%d",&startyear,&startmonth,&startday);
	scanf("%d%d%d",&endyear,&endmonth,&endday);
	total=0;
	for(i=startyear;i<endyear;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0)
		{
			total=total+366;
		}
		else
		{
			total=total+365;
		}
	}
	if(endyear%4==0&&endyear%100!=0||endyear%400==0)
	{
		if(endmonth>=startmonth)
		{
			for(j=startmonth;j<endmonth;j++)
			{
				total=total+B[j-1];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
		if(endmonth<startmonth)
		{
			for(j=startmonth;j>endmonth;j--)
			{
				total=total-B[j-2];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
	}
	else
	{
		if(endmonth>=startmonth)
		{
			for(j=startmonth;j<endmonth;j++)
			{
				total=total+A[j-1];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
		if(endmonth<startmonth)
		{
			for(j=startmonth;j>endmonth;j--)
			{
				total=total-A[j-2];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
	}
	return 0;
}


/*
 * c.cpp
 * ???1100012870;
 * ???????
 *  Created on: 2011-11-4
 *      Author: Li Wenpeng
 */
int judge(int x)
{
	if (x%400==0) return 1;
	if (x%100==0) return 0;
	if (x%4==0) return 1;
	return 0;
}
int main()
{
	const int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int year1,year2,day1,day2,month1,month2,i,ans=0;
	cin>>year1>>month1>>day1>>year2>>month2>>day2;
	if (year1==year2){
		for(i=month1;i<month2;i++) ans=ans+a[i];
		ans=ans+day2-day1;
		cout<<ans<<endl;
		return 0;
	}
    for(i=year1+1;i<year2;i++)
    	ans=ans+365+judge(i);
    for(i=1;i<month2;i++){
    	ans=ans+a[i];
    	if(i==2)ans=ans+judge(year2);
    }
    for(i=month1;i<=12;i++){
    	ans=ans+a[i];
    	if(i==2)ans=ans+judge(year1);
    }
    ans=ans+day2-day1;
    cout<<ans<<endl;
    return 0;
}


int main()
{
	int startYear, startMonth, startDay, endYear, endMonth, endDay, ans = 0, day = 0, i;
	cin >> startYear >> startMonth >> startDay >> endYear >> endMonth >> endDay;
	for (i = startYear; i < endYear; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			ans = ans + 366;
		else
			ans = ans + 365;
	}
	for (i = 1; i < startMonth; i++)
	{
		if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12))
			day = day + 31;
		else if (i == 2)
			{
				if ((startYear % 4 == 0 && startYear % 100 != 0) || (startYear % 400 == 0))
					day = day + 29;
				else
					day = day + 28;
			}
			else
				day = day + 30;
	}
	for (i = 1; i < startDay; i++)
		day++;
	ans = ans - day;
	day = 0;
	for (i = 1; i < endMonth; i++)
	{
		if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12))
			day = day + 31;
		else if (i == 2)
			{
				if ((endYear % 4 == 0 && endYear % 100 != 0) || (endYear % 400 == 0))
					day = day + 29;
				else
					day = day + 28;
			}
			else
				day = day + 30;
	}
	for (i = 1; i < endDay; i++)
		day++;
	ans = ans + day;
	cout << ans << endl;
	return 0;
}


int main(){
    int startYear,startMonth,startDay,endYear,endMonth,endDay;
    int s,i,days,days1,days2,year;
    cin>>startYear>>startMonth>>startDay>>endYear>>endMonth>>endDay;
    days=0;days1=0;days2=0;
    int month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    for(i=1;i<startMonth;i++)
    {if((startYear%4==0&&startYear%100!=0)||(startYear%400==0))
		month[2]=29;
    	days1=days1+month[i];}
    days1=days1+startDay;
    for(i=endMonth;i<13;i++)
    	{if((endYear%4==0&&endYear%100!=0)||(endYear%400==0))
    		month[2]=29;
    	days2=days2+month[i];}
    days2=days2-endDay;
    s=0;
    for(year=startYear;year<=endYear;year++)
    	if((year%4==0&&year%100!=0)||(year%400==0))
    		s++;
    days=365*(endYear-startYear+1)-days2-days1+s;
    cout<<days;
  return 0;
}