semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{int y1,y2,m1,m2,d1,d2,i,j,t,p,x1,x2,x3;
int e[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};
   scanf("%d%d%d\n%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);

   if(y1<y2) {t=y1;y1=y2;y2=t;t=m1;m1=m2;m2=t;t=d1;d1=d2;d2=t;}
   for(i=y2,p=0;i<y1;i++)
   {if((i%4==0&&i%100!= 0) || (i%400==0))   p++;
   }
   x1=365*(y1-y2)+p;
    
   t=0;
    if(((y1%4==0&&y1%100!=0) || (y1%400==0))&&m1>2) t=1;
    x2=e[m1]+d1+t;

    t=0;
    if(((y2%4==0&&y2%100!=0) || (y2%400==0))&&m2>2) t=1;
    x3=e[m2]+d2+t;
   
   x1=x1+x2-x3;
   if(x1<0) x1=-x1;
   printf("%d\n",x1);

return 0;
}
int main()
{
	int year1,year2,month1,month2,day1,day2,a,b,year,days,i;
	scanf("%d%d%d\n",&year1,&month1,&day1);
	scanf("%d%d%d",&year2,&month2,&day2);
	if((year1%4==0&&year1%100!=0)||(year1%400==0))
	{
		switch(month1)
		{
		case 1:
			a=day1;
			break;
		case 2:
			a=31+day1;
			break;
		case 3:
			a=60+day1;
			break;
		case 4:
			a=91+day1;
			break;
		case 5:
			a=121+day1;
			break;
		case 6:
			a=152+day1;
			break;
		case 7:
			a=182+day1;	
			break;	
		case 8:
			a=213+day1;	
			break;	
		case 9 :
			a=244+day1;	
			break;	
		case 10:
			a=274+day1;	
			break;	
		case 11:
			a=305+day1;
			break;		
		case 12:
			a=335+day1;
			break;
		}
	}
	else
	{
		switch (month1)
		{
		case 1:
			a=day1;
			break;
		case 2:
			a=31+day1;
			break;
		case 3:
			a=59+day1;
			break;
		case 4:
			a=90+day1;
			break;
		case 5:
			a=120+day1;
			break;
		case 6:
			a=151+day1;
			break;
		case 7:
			a=181+day1;
			break;		
		case 8:
			a=212+day1;	
			break;	
		case 9:
			a=243+day1;
			break;		
		case 10 :
			a=273+day1;	
			break;	
		case 11:
			a=304+day1;	
			break;	
		case 12:
			a=334+day1;
			break;
		}
	}
	if((year2%4==0&&year2%100!=0)||(year2%400==0))
	{
		switch (month2)
		{
		case 1:
			b=day2;
			break;
		case 2:
			b=31+day2;
			break;
		case 3:
		    b=60+day2;
			break;
		case 4:
			b=91+day2;
			break;
		case 5:
			b=121+day2;
			break;
		case 6:
			b=152+day2;
			break;
		case 7:
			b=182+day2;	
			break;	
		case 8:
			b=213+day2;	
			break;	
		case 9:
			b=244+day2;	
			break;	
		case 10 :
			b=274+day2;	
			break;	
		case 11:
			b=305+day2;	
			break;	
		case 12:
			b=335+day2;
			break;
		}
	}
	else
	{
		switch (month2)
		{
		case 1:
			b=day2;
			break;
		case 2:
			b=31+day2;
			break;
		case 3:
			b=59+day2;
			break;
		case 4:
			b=90+day2;
			break;
		case 5:
			b=120+day2;
			break;
		case 6:
			b=151+day2;
			break;
		case 7:
			b=181+day2;
			break;		
		case 8:
			b=212+day2;	
			break;	
		case 9:
			b=243+day2;
			break;		
		case 10:
			b=273+day2;
			break;		
		case 11:
			b=304+day2;
			break;		
		case 12:
			b=334+day2;
			break;
		}
	}
	year=0;
	for(i=year1;i<year2;i++)
	{
		if ((i%4==0&&i%100!=0)||(i%400==0))
			year=year+366;
		else
			year=year+365;
	}
	days=b-a+year;
	printf("%d",days);
	return 0;
}
int main()
{
int m1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},m2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31},a1,a2,a3,b1,b2,b3,s,i,j,y1=0,y2=0,y,x1=0,x2=0,x;
scanf("%d %d %d\n%d %d %d",&a1,&a2,&a3,&b1,&b2,&b3);
for(i=1700;i<a1;i++){

                                if((i%4==0&&i%100!=0)||i%400==0)
				 y1+=366;
			 else
				 y1+=365;}
if((a1%4==0&&a1%100!=0)||a1%400==0)
{for(i=0;i<a2;i++){
y2=y2+m2[i];}}
else {for(i=0;i<a2;i++){
y2=y2+m1[i];}};
y=y1+y2+a3;
for(i=1700;i<b1;i++){

                                if((i%4==0&&i%100!=0)||i%400==0)
				 x1+=366;
			 else
				 x1+=365;}
if((b1%4==0&&b1%100!=0)||b1%400==0)
{for(i=0;i<b2;i++){
x2=x2+m2[i];}}
else {for(i=0;i<b2;i++){
x2=x2+m1[i];}};
x=x1+x2+b3;
s=x-y;
printf("%d",s);
return 0;
}
int main()
{
	int days[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 syear,smonth,sday,eyear,emonth,eday;

	cin>>syear>>smonth>>sday>>eyear>>emonth>>eday;

	int r;
	int i,year,end;
	int num=0;

	if((syear % 4 == 0 && syear % 100 != 0) || (syear % 400 == 0))
		r=1;
	else
		r=0;

	if(eyear!=syear)
	{
			num+=days[r][smonth]-sday;
	}
	else
	{
		if(emonth!=smonth)
			num+=days[r][smonth]-sday;
	}
	if(eyear==syear)
		end=emonth-1;
	else
		end=12;

	for(i=smonth+1;i<=end;i++)
		num+=days[r][i];

	for(year=syear+1;year<eyear;year++)
	{
		if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
			r=1;
		else
			r=0;
		num+=365+r;
	}

	if((eyear % 4 == 0 && eyear % 100 != 0) || (eyear % 400 == 0))
			r=1;
		else
			r=0;


	i=1;
	if(eyear==syear)
		i=smonth+1;
	for(;i<emonth;i++)
		num+=days[r][i];

	if(eyear!=syear)
	{
		num+=eday;
	}
	else
	{
		if(emonth == smonth)
		num+=(eday-sday);
		else
			num+=eday;
	}
	cout<<num<<endl;
	return 0;
}
void main()
{
	int a1,a2,b1,b2,c1,c2;
	int num,i;

	scanf("%d %d %d",&a1,&b1,&c1);
	scanf("%d %d %d",&a2,&b2,&c2);

	int pdrun(int);
	int tohead(int,int,int);
	int toend(int,int,int);

	if(a1==a2)num=tohead(a2,b2,c2)-tohead(a1,b1,c1);
	if(a1!=a2){num=tohead(a2,b2,c2)+toend(a1,b1,c1);
	          for(i=a1+1;i<a2;i=i+1)
			  {
				  if(pdrun(i)==1)num=num+366;
				  else num=num+365;
			  }
		
	}

	printf("%d",num);
}

int pdrun(int i)
{
	int n;
	if(i%4==0&&i%100!=0||i%400==0)n=1;
	 else n=0;
	 return(n);
}

tohead(int x,int y,int z)
{
	int sum;
    int	pdrun(int);
	sum=0;
	switch(y)
	{	case 12:sum=sum+30;
	case 11:sum=sum+31;
	case 10:sum=sum+30;
	case 9:sum=sum+31;
	case 8:sum=sum+31;
	case 7:sum=sum+30;
	case 6:sum=sum+31;
	case 5:sum=sum+30;
	case 4:sum=sum+31;
	case 3:if(pdrun(x)==1)sum=sum+29;else sum=sum+28;
	case 2:sum=sum+31;
	case 1:sum=sum+z;

	}
	return(sum);

}
int toend(int x,int y,int z)
{
	int sum;


	if(pdrun(x)==1)sum=366-tohead(x,y,z);
	else sum=365-tohead(x,y,z);

	return(sum);

}
int years(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return  366;
	else return 365;
}
int months (int month,int year)
{
	if( month==1||month==3||month==5||month==7||month==8||month==10||month==12)
		return 31;
	if(month==4||month==6||month==9||month==11)
		return 30;
	if(years(year)==366)
		return 29;
	return 28;
}
int main()
{
	int day1[3]={0},day2[3]={0},sum=0;
	for ( int i=0;i<3;i++)
		cin>>day1[i];
	for ( int i=0;i<3;i++)
		cin>>day2[i];
	for ( int i=day1[0]+1;i<day2[0];i++)
		sum=sum+years(i);
	if(day1[0]!=day2[0])
	{
	for ( int i=day1[1];i<=12;i++)
		sum=sum+months(i,day1[0]);
	for ( int i=1;i<day2[1];i++)
		sum=sum+months(i,day2[0]);
	
	}
	else
			for ( int i=day1[1];i<day2[1];i++)
				sum=sum+months(i,day2[0]);
	sum=sum+day2[2]-day1[2];
	cout<<sum<<endl;
	
	return 0;

}
int runnian(int);
  int yuefen(int,int,int);

int main()
{ 
  int year1,month1,day1,year2,month2,day2;
  cin>>year1>>month1>>day1>>year2>>month2>>day2;
  int i,answer=0;
  for (i=year1;i<year2;i++)
	  answer+=runnian(i)+365;
  answer=answer-yuefen(year1,month1,day1)+yuefen(year2,month2,day2);
  cout<<answer;
  return 0;
}

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

int yuefen(int year,int month,int day)
{
	int ans=0;
	switch(month)
	{
	case 12:ans+=30;
	case 11:ans+=31;
	case 10:ans+=30;
	case 9:ans+=31;
	case 8:ans+=31;
	case 7:ans+=30;
	case 6:ans+=31;
	case 5:ans+=30;
	case 4:ans+=31;
	case 3:ans+=28+runnian(year);
	case 2:ans+=31;
	case 1:ans+=0;
	}
    ans+=day;
	return ans;
}
int day(int year,int month,int day)
{
	int i,k=day;
	for(i=1;i<month;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10) k=k+31;
		if(i==2)
		{
			if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0) k=k+29;
			else k=k+28;
		}
		if(i==4||i==6||i==9||i==11) k=k+30;
	}
	return k;
}
void main()
{
	int Y,M,D,y,m,d,a,b,c,x=0,j;
	scanf("%d%d%d%d%d%d",&Y,&M,&D,&y,&m,&d);
	if(Y>y||Y==y&&M>m||Y==y&&M==m&&D>d)
	{
		a=Y;
		b=M;
		c=D;
		Y=y;
		M=m;
		D=d;
		y=a;
		m=b;
		d=c;
	}
	for(j=Y;j<y;j++)
	{
		if(j%4==0&&j%100!=0||j%400==0) x=x+366;
		else x=x+365;
	}
	x=x+day(y,m,d)-day(Y,M,D);
	printf("%d\n",x);
}
void main()
{
	int y1,m1,d1,y2,m2,d2,i;
    int a1=0,a2=0,b1=0,b2=0,n1,n2,n;
	scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
	for(i=1;i<y1;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0)
			a1=a1+366;
		else a1=a1+365;
	}
    for(i=1;i<m1;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
			b1=b1+31;
		else if(i==4||i==6||i==9||i==11)
			b1=b1+30;
		else if(y1%4==0&&y1%100!=0||y1%400==0)
			b1=b1+29;
		else b1=b1+28;
	}
    for(i=1;i<y2;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0)
			a2=a2+366;
		else a2=a2+365;
	}
    
    for(i=1;i<m2;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
			b2=b2+31;
		else if(i==4||i==6||i==9||i==11)
			b2=b2+30;
		else if(y2%4==0&&y2%100!=0||y2%400==0)
			b2=b2+29;
		else b2=b2+28;
	}
	n1=a1+b1+d1;
	n2=a2+b2+d2;
	n=n2-n1;
	printf("%ld\n",n);
}
int main()
 {
  int a,b,c,x,y,z,i,n=0,e,f,h;
  scanf("%d %d %d\n%d %d %d",&a,&b,&c,&x,&y,&z);
  for (i=a;i<x;i++)
  {if ((i%4==0&&i%100!=0)||(i%400==0)) n++;}
  {if ((a%4==0&&a%100!=0)||(a%400==0))
   switch (b)
{case 1:e=0;break;case 2:e=31;break;case 3:e=60;break;case 4:e=91;break;case 5:e=121;break;case 6:e=152;break; case 7:e=182;break; case 8:e=213; break;case 9:e=244;break;case 10:e=274;break; case 11:e=305; break;case 12:e=335;break;}
 else  
 switch(b)
{case 1:e=0;break;case 2:e=31;break;case 3:e=59;break;case 4:e=90;break;case 5:e=120;break;case 6:e=151;break; case 7:e=181;break; case 8:e=212; break;case 9:e=243;break;case 10:e=273;break; case 11:e=304; break;case 12:e=334;break;}}
 {if ((x%4==0&&x%100!=0)||(x%400==0))
 switch (y)
{case 1:f=0;break;case 2:f=31;break;case 3:f=60;break;case 4:f=91;break;case 5:f=121;break;case 6:f=152; break;case 7:f=182; break;case 8:f=213; break;case 9:f=244;break;case 10:f=274; break;case 11:f=305; break;case 12:f=335;break;}
 else switch(y)
{case 1:f=0;break;case 2:f=31;break;case 3:f=59;break;case 4:f=90;break;case 5:f=120;break;case 6:f=151; break;case 7:f=181;break; case 8:f=212;break; case 9:f=243;break;case 10:f=273; break;case 11:f=304; break;case 12:f=334;break;}}
h=365*(x-a)+n+f+z-e-c;
 printf ("%d",h);
}
int main()
{
	int a,b,c,d,e,f;
	scanf("%d%d%d\n%d%d%d",&a,&b,&c,&d,&e,&f);
	int i,j,k,l,m,n;
	i=1; 
	m=0;
	while(i<a)
	{if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)) m=m+366;
	else m=m+365;
	i=i+1;
	}
	j=1;
	while(j<b)
	{if ((j==1)||(j==3)||(j==5)||(j==7)||(j==8)||(j==10)) m=m+31;
	else if((j==4)||(j==6)||(j==9)||(j==11)) m=m+30;
		else if((j==2)&&(a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) m=m+29;
		else m=m+28;
		j=j+1;
	}
	m=m+c;
	k=1; 
	n=0;
	while(k<d)
	{if ((k % 4 == 0 && k % 100 != 0) || (k % 400 == 0)) n=n+366;
	else n=n+365;
	k=k+1;
	}
	l=1;
	while(l<e)
	{if ((l==1)||(l==3)||(l==5)||(l==7)||(l==8)||(l==10)) n=n+31;
	else if((l==4)||(l==6)||(l==9)||(l==11)) n=n+30;
		else if((l==2)&&(d % 4 == 0 && d % 100 != 0) || (d % 400 == 0)) n=n+29;
		else n=n+28;
		l=l+1;
	}
	n=n+f;
	printf("%d",n-m);
	return 0;
}
int leap(int year){
    if(year%4==0){
        if(year%100==0){
            if(year%400==0){
                return 1;
            }
            return 0;
        }
        return 1;
    } 
    return 0;
} 
int main()
{
    int sy,sm,sd; 
    int ey,em,ed; 
    int monthday[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}};
    scanf("%d %d %d",&sy,&sm,&sd);      //????? 
    scanf("%d %d %d",&ey,&em,&ed);      //????? 
    int tmp;
    if((sy>ey)||(sy==ey && sm>em)||(sy==ey && sm==em && sd>ed)){ //???????? ???????????? 
        tmp=sy; sy=ey; ey=tmp;
        tmp=sm; sm=em; em=tmp;
        tmp=sd; sd=ed; ed=tmp;
    }
    int ans=0;
    while(sy!=ey || sm!=em || sd!=ed){
        ans++;
        sd++;
        if(sd>monthday[leap(sy)][sm]){
            sd=1;
            sm++;
        } 
        if(sm==13){
            sm=1;
            sy++;
        } 
    }
    printf("%d\n",ans);
        return 0;
}
/*
 * distanceofdates.cpp
 *
 *  Created on: 2011-11-4
 *      Author: LTY
 */
int main(){
	int startyear,startmonth,startday,endyear,endmonth,endday;
	int days1,days2,days3,i,j=0,t=0;
	cin>>startyear>>startmonth>>startday;
	cin>>endyear>>endmonth>>endday;
	if((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0))
		{
		int month[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
		days1=startday;
		for(i=1;i<startmonth;i++)
			days1=days1+month[i];
		}
	else
		{
		int month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
		days1=startday;
		for(i=1;i<startmonth;i++)
			days1=days1+month[i];
		}
	if((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0))
			{
			int month[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
			days2=endday;
			for(i=1;i<endmonth;i++)
				days2=days2+month[i];
			}
		else
			{
			int month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
			days2=endday;
			for(i=1;i<endmonth;i++)
				days2=days2+month[i];
			}
	for(i=startyear;i<endyear;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			j=j+1;
		else
			t=t+1;
	}
	days3=(days2-days1)+j*366+t*365;
	cout<<days3<<endl;
	return 0;
}
int main()
{
	int A,B,C,a,b,c,i,j,day=0;
	scanf("%d %d %d\n%d %d %d",&A,&B,&C,&a,&b,&c);
	if(A<a){
		for(j=B;j<=12;j++){
		if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			day+=31;
		if(j==4||j==6||j==9||j==11)
			day+=30;
		if(j==2&&(A%4==0&&A%100!=0||A%400==0))
			day+=29;
		if(j==2&&(A%4!=0||(A%100==0&&A%400!=0)))
			day+=28;
		}
		day-=C-1;
	if(a-A>1){
		for(i=A+1;i<=a-1;i++){
			if(i%4==0&&i%100!=0||i%400==0){
			day+=366;
			}else{
			day+=365;
			}
		}
	}
	for(j=0;j<=b-1;j++){
		if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			day+=31;
		if(j==4||j==6||j==9||j==11)
			day+=30;
		if(j==2&&(a%4==0&&a%100!=0||a%400==0))
			day+=29;
		if(j==2&&(a%4!=0||(a%100==0&&a%400!=0)))
			day+=28;
		if(j==0)
			day+=0;
	}
	day+=c-1;
	}
	if(A==a){
		if(B==b)
		day=c-C;
		if(b>B){
		if(B==1||B==3||B==5||B==7||B==8||B==10||B==12)
			day+=31;
		if(B==4||B==6||B==9||B==11)
			day+=30;
		if(B==2&&(A%4==0&&A%100!=0||A%400==0))
			day+=29;
		if(B==2&&(A%4!=0||(A%100==0&&A%400!=0)))
			day+=28;
		day-=C-1;
		if(b-B>1){
			for(j=B+1;j<=b-1;j++){
			if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			day+=31;
			if(j==4||j==6||j==9||j==11)
			day+=30;
			if(j==2&&(A%4==0&&A%100!=0||A%400==0))
			day+=29;
			if(j==2&&(A%4!=0||(A%100==0&&A%400!=0)))
			day+=28;
			}
		}
		day+=c-1;
		}
	}
	printf("%d",day);
	return 0;
}
int main()
{
	int syear,smonth,sday,eyear,emonth,eday,cha=0;
	cin>>syear>>smonth>>sday>>eyear>>emonth>>eday;
	int sum1=0,sum2=0;
	switch(smonth)
	{
	case 1:sum1+=0;break;
	case 2:sum1+=31;break;
	case 3:sum1+=31+28;break;
	case 4:sum1+=31+28+31;break;
	case 5:sum1+=31+28+31+30;break;
	case 6:sum1+=31+28+31+30+31;break;
	case 7:sum1+=31+28+31+30+31+30;break;
	case 8:sum1+=31+28+31+30+31+30+31;break;
	case 9:sum1+=31+28+31+30+31+30+31+31;break;
	case 10:sum1+=31+28+31+30+31+30+31+31+30;break;
	case 11:sum1+=31+28+31+30+31+30+31+31+30+31;break;
	case 12:sum1+=31+28+31+30+31+30+31+31+30+31+30;break;
	default: break;
	}
	switch(emonth)
	{
	case 1:sum2+=0;break;
	case 2:sum2+=31;break;
	case 3:sum2+=31+28;break;
	case 4:sum2+=31+28+31;break;
	case 5:sum2+=31+28+31+30;break;
	case 6:sum2+=31+28+31+30+31;break;
	case 7:sum2+=31+28+31+30+31+30;break;
	case 8:sum2+=31+28+31+30+31+30+31;break;
	case 9:sum2+=31+28+31+30+31+30+31+31;break;
	case 10:sum2+=31+28+31+30+31+30+31+31+30;break;
	case 11:sum2+=31+28+31+30+31+30+31+31+30+31;break;
	case 12:sum2+=31+28+31+30+31+30+31+31+30+31+30;break;
	default: break;
	}
	int sum=0,year;
	for(year=syear+1;year<eyear;year++)
		if((year%4==0&&year%100!=0)||(year%400==0))
			sum++;
	if(eyear-syear>=1)
	   cha=cha+sum+365*(eyear-syear-1);
	sum1=sum1+sday;sum2=sum2+eday;
	if(((syear%4==0&&syear%100!=0)||(syear%400==0))&&smonth>=3)
		sum1=sum1;
	if(((syear%4==0&&syear%100!=0)||(syear%400==0))&&smonth<3)
		sum1=sum1-1;
	if(((eyear%4==0&&eyear%100!=0)||(eyear%400==0))&&emonth>=3)
		sum2=sum2+1;
	if(((eyear%4==0&&eyear%100!=0)||(eyear%400==0))&&emonth<3)
		sum2=sum2;
	if(eyear-syear>=1)
	cha=cha+365-sum1+sum2;
	if(eyear-syear==0)
		cha=sum2-sum1;
	cout<<cha<<endl;
	return 0;
}
/*
 * 3.cpp
 *
 *  Created on: 2011-1-9
 *      Author: jsgl
 */
int main()
{
	int y1,m1,d1,y2,m2,d2,sum=0;
	int i;

	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	int a[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
	
		
	if(y1<y2)
	{
	if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
	{
		a[2]=29;
	}
	else a[2]=28;
	for(i=m1+1;i<12;i++)
		sum=sum+a[i];
	sum=sum+a[m1]-d1;
	if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
		{
			a[2]=29;
		}
	else a[2]=28;
	for(i=1;i<m2;i++)
		sum=sum+a[i];
	sum=sum+d2;
	for(i=y1+1;i<y2;i++)
	{
	if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
		sum=sum+366;
	else
		sum=sum+365;
	}
	cout<<sum+1+30;
	}
   if(y1==y2)
   {
	   if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
	   		{
	   			a[2]=29;
	   		}
	 	else a[2]=28;
	   if(m1==m2)
	   {
		   sum=d2-d1;
		   cout<<sum;
	   }
	   else
	   {
	   for(i=m1+1;i<m2;i++)
		   sum=sum+a[i];
	   sum=sum+a[m1]-d1+d2;
	   cout<<sum;}
   }
	return 0;
}
void main()
{
	int a,b,c,d,e,f,g,n,m,i;
	int rui(int x);
	int day(int p,int q);
	scanf("%d%d%d",&a,&b,&c);
	scanf("%d%d%d",&e,&f,&g);
	n=day(a,b)+c;
	m=day(e,f)+g;
	for (i=a;i<=e-1;i++)
	{if (rui(i)==0) m=m+365;
		else m=m+366;}
	printf("%d",m-n);
}
int rui(int x)
{
   int z;
   if ((x%4==0&&x%100!=0)||(x%400==0))
	   z=1;
   else z=0;
   return(z);
}
int day(int p,int q)
{
	int l=0;
	switch(q)
	{ case 12:l=l+30;
	  case 11:l=l+31;
	  case 10:l=l+30;
	  case 9:l=l+31;
	  case 8:l=l+31;
	  case 7:l=l+30;
	  case 6:l=l+31;
	  case 5:l=l+30;
   	  case 4:l=l+31;
	  case 3:{ if (rui(p)==0) l=l+28;
		  else l=l+29;}
	  case 2:l=l+31;
	  case 1:l=l+0;
			 }
		  return(l);
}
/*
 * 1000012889_3.cpp
 *
 *  Created on: 2011-1-9
 *      Author: ???
 *        ??: ???????????
 */



int main(){
	int monp[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int monr[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int year1,year2,mon1,mon2,day1,day2,np=0,nr=0,i,num=0;
	cin>>year1>>mon1>>day1;
	cin>>year2>>mon2>>day2;
	for(i=year1+1;i<year2;i++){
		if((i%4==0&&i%100!=0)||(i%400==0))
			nr++;
		else
			np++;
	}
	if((year1%4==0&&year1%100!=0)||(year1%400==0)){
		for(i=1;i<mon1;i++)
			num+=monr[i];
		num+=day1;
		if(year1<year2)
			num=366-num;
		else
			num=-num;
	}
	else{
		for(i=1;i<mon1;i++)
			num+=monp[i];
		num+=day1;
		if(year1<year2)
			num=365-num;
		else
			num=-num;
	}
	if((year2%4==0&&year2%100!=0)||(year2%400==0)){
		for(i=1;i<mon2;i++)
			num+=monr[i];
		num+=day2;
	}
	else{
		for(i=1;i<mon2;i++)
			num+=monp[i];
		num+=day2;
	}
	num+=nr*366+np*365;
	cout<<num<<endl;
	return 0;
}
/*
 * ????.cpp
 *
 *  Created on: 2011-1-9
 *      Author: jsgl
 */


int main(){
	int y1,y2,m1,m2,d1,d2,sum=0,sum1=0,sum2=0,sum3=0;
	int month1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int month2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int i,j,k,l;
	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	if(y1==y2){
		if((y1%400==0)||((y1%4==0)&&(y1%100!=0))){
			for(i=m1;i<m2;i++)
				sum=sum+month2[i];
			sum=sum+d2-d1;
		}
		else{
			for(i=m1;i<m2;i++)
				sum=sum+month1[i];
			sum=sum+d2-d1;
		}
	}
	else{
		if((y1%400==0)||((y1%4==0)&&(y1%100!=0))){
			for(i=m1;i<=12;i++)
				sum1=sum1+month2[i];
			sum1=sum1-d1;
		}
		else{
			for(i=m1;i<=12;i++)
				sum1=sum1+month1[i];
			sum1=sum1-d1;
		}
		if((y2%400==0)||((y2%4==0)&&(y2%100!=0))){
			for(i=1;i<m2;i++)
				sum2=sum2+month2[i];
			sum2=sum2+d2;
		}
		else{
			for(i=1;i<m2;i++)
				sum2=sum2+month1[i];
			sum2=sum2+d2;
		}
		for(j=y1+1;j<y2;j++){
			if((j%400==0)||((j%4==0)&&(j%100!=0)))
				sum3=sum3+366;
			else
				sum3=sum3+365;
		}
		sum=sum1+sum2+sum3;
	}
	cout<<sum<<endl;
	return 0;
}
void main()
{
	int sy,sm,sd,ey,em,ed,d;
	scanf("%d%d%d",&sy,&sm,&sd);
    scanf("%d%d%d",&ey,&em,&ed);
	d=0;
	for(;;)
	{
			if(sy==ey&&sm==em&&sd==ed)
		{
			break;
		}
		if(sm==1||sm==3||sm==5||sm==7||sm==8||sm==10||sm==12)
		{
			if(sm==12&&sd==31)
			{
				sy++;
				sm=1;
				sd=1;
				d++;
				continue;
			}
			if(sd==31)
			{
				sm++;
				sd=1;
				d++;
				continue;
			}
			else
			{
				sd++;
				d++;
				continue;
			}

		}
		if(sm==4||sm==6||sm==9||sm==11)
		{
			if(sd==30)
			{
				sm++;
				sd=1;
				d++;
				continue;
			}
			else
			{
				sd++;
				d++;
				continue;
			}			
		}
		if(sm==2)
		{
			if((sy % 4 == 0 && sy % 100 != 0) || (sy % 400 == 0) )
			{
				if(sd==29)
				{
					sm++;
					sd=1;
					d++;
					continue;
				}
				else
				{
					sd++;
					d++;
			 		continue;
				}	
			}
			else
			{
				if(sd==28)
				{
					sm++;
					sd=1;
					d++;
					continue;
				}
				else
				{
					sd++;
					d++;
					continue;
				}			
			}
		}

	}
	printf("%d",d);
}
int main()
{
	int monthday_ping[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int monthday_run[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	struct cal
	{
		int year;
		int month;
		int day;
	}date[2];
	
	int yy,mm,dd,sum=0,i;
	cin>>date[0].year>>date[0].month>>date[0].day;
	cin>>date[1].year>>date[1].month>>date[1].day;
	if(date[1].year-date[0].year>0)
	{
	if(date[1].year-date[0].year>1)
	{
		sum=365*(date[1].year-date[0].year-1);
	}
	for(i=date[0].month;i<=12;i++)
	{
		sum=sum+monthday_ping[i];
	}
	sum=sum-date[0].day;
	for(i=1;i<date[1].month;i++)
	{
		sum=sum+monthday_ping[i];
	}
	sum=sum+date[1].day;
	}
	else
	{
		if(date[0].month<date[1].month)
		{
		for(i=date[0].month;i<date[1].month;i++)
		{
			sum=sum+monthday_ping[i];
		}
		sum=sum-date[0].day+date[1].day;
		}
		else sum=date[1].day-date[0].day;
	}

	
	for(i=date[0].year+1;i<date[1].year;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
		{
			sum++;
		}
	}
	if((date[0].year%4==0&&date[0].year%100!=0)||(date[0].year%400==0))
	{
		if((date[0].month<2)||(date[0].month=2&&date[0].day!=29))
		{
			sum++;
		}
	}
	if((date[1].year%4==0&&date[1].year%100!=0)||(date[1].year%400==0))
	{
		if((date[1].month=2)||(date[1].month=2&&date[1].day!=29))
		{
			sum++;
		}
	}
	cout<<sum;
	return 0;
}
void main()
{
	long int sy,sm,sd,ey,em,ed,a,b,i,j,k,x;
	scanf("%d %d %d %d %d %d",&sy,&sm,&sd,&ey,&em,&ed);
	a=1;i=0;

	while(a<sy)
	{
		if((a%4==0 &&a%100!=0)||(a%400==0)) 
		{i++;a++;}
		else
			a++;
	}
	if(((sy%4==0 &&sy% 100 != 0)||(sy% 400 ==0))&&(sm>2))
		i++;

	b=1;j=0;
	while(b<sm)
	{
		if((b==1)||(b==3)||(b==5)||(b==7)||(b==8)||(b==10)||(b==12))
		{j++;
		}
		else 
		{
			if(b==2)
				j=j-2;
		}
		b++;
	}
	k=sy*365+sm*30+sd+j+i;


	long int A,B,I,J,K;
	I=0;A=1;

	while(A<ey)
	{
		if((A%4==0 &&A% 100 != 0)||(A%400 ==0))
		{
			I++;
			A++;
		}
		else
			A++;
	}
	if(((ey%4==0&&ey%100!=0)||(ey% 400 ==0))&&(em>2))
		I++;

	B=1;J=0;
	while(B<em)
	{
		if((B==1)||(B==3)||(B==5)||(B==7)||(B==8)||(B==10)||(B==12))
		{J++;
		}
		else
		{
			if(B==2)
				J=J-2;
		}
		B++;
	}
	K=ey*365+em*30+ed+J+I;
	x=K-k;


	printf("%d\n",x);
}
int main()
{
	int a[13][32],b[373],i,j,k,y1,m1,d1,y2,m2,d2,q,x1,x2,q1,q2,fuhao;
	scanf("%d%d%d",&y1,&m1,&d1);
	scanf("%d%d%d",&y2,&m2,&d2);
	for(i=1;i<13;i++)
	{
		for(j=1;j<32;j++)
		{
			a[i][j]=1;
		}
	}
	a[2][29]=0;a[2][30]=0;a[2][31]=0;a[4][31]=0;a[6][31]=0;a[9][31]=0;a[11][31]=0;
	for(i=1,k=1;i<13;i++)
	{
		for(j=1;j<32;j++)
		{
			b[k]=a[i][j];
			k=k+1;
		}
	}
	x1=(m1-1)*31+d1;
	x2=(m2-1)*31+d2;
	fuhao=1;
	if(x1>x2)
	{
		fuhao=x1;
		x1=x2;
		x2=fuhao;
		fuhao=-1;
	}
	for(q=0,k=x1;k<x2;k++)
		q=(q+b[k]);
	q=365*(y2-y1)+q*fuhao;

	for(i=y1+1,q1=0;i<y2;i++)
	{
		if(i%4==0&&i%100!=0)q1=q1+1;
		if(i%400==0)q1=q1+1;		
	}
	if((y1%4==0&&y1%100!=0)||(y1%400==0))
	{
		if(m1==1)q1=q1+1;
		if(m1==2&&d1<=29)q1=q1+1;
	}
	if((y2%4==0&&y2%100!=0)||(y2%400==0))
	{
		if(m2>=3)q1=q1+1;
		if(m2==2&&d2==29)q1=q1+1;
	}
	q=q+q1;
	printf("%d",q);
	return 0;


	


}
int main()
{
int result = 0;
int y1,m1,d1,y2,m2,d2,i,ylp;
int day[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 year[2] = {365,366};
cin>>y1>>m1>>d1;
cin>>y2>>m2>>d2;
 

ylp = y2-y1-1;

if(ylp >0){
	for(i=y1+1;i<y2;i++){
	     result += year[  (i % 4 == 0 && i % 100 != 0) || (i % 400 == 0) ];
	}
	
}

if(y1 != y2){
if(m1 < 12){
	for(i = m1;i<12;i++){
	     result += day[(y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0) ][ i];
	}
}




if(m2>1) {
	for(i = 0;i<m2-1;i++){
	     result += day[(y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0)][i ] ;
	}
 
}
result += day[(i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)][m1-1 ] - d1;
result += d2;
}
else{

	if(m1 != m2){
       for(i=m1;i<m2-1;i++){
	      result += day[(y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0)][i ] ;
	   }
       result += day[(i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)][m1-1 ] - d1;
    	result += d2;
	  
	}
	else{
	    result +=d2-d1;
	}
}

	
cout<<result<<endl;
return 0;
}