semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int y1,y2,m1,m2,d1,d2,sum=0;
	cin >>y1>>m1>>d1>>y2>>m2>>d2;
	for (int year = y1 + 1; year < y2; year++)
		sum += 365 + ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
	int num1[12] = {31,28,31,30,31,30,31,31,30,31,30,31},num2[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
	int m;
	if ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
	{
		sum += (num2[m1 - 1] - d1);
		for (m = m1 + 1; m <=12;m++)
			sum += num2[m-1];
	}
	else
	{
		sum += (num1[m1 - 1] - d1);
		for (m = m1 + 1; m <=12;m++)
			sum += num1[m-1];
	}
	sum += d2;
	if ((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
	{
		for (m = 1; m < m2;m++)
			sum += num2[m-1];
	}
	else
	{
		for (m = 1; m < m2;m++)
			sum += num1[m-1];
	}
	if(y1 == y2)
		sum -= (365 + ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0)));
	cout <<sum <<endl;
	return 0;
}
main()
{
  int j,i,f[3],l[3],leap[2]={0,0},mth[12]={31,28,31,30,31,30,31,31,30,31,30,31};
  int n=0,inter=0,df=0,df2=0,dl=0,dn=0,lp(int y);
  for(i=0;i<=2;i++)scanf("%d",&f[i]);
  for(i=0;i<=2;i++)scanf("%d",&l[i]);
  leap[0]=lp(f[Y]);
  leap[1]=lp(l[Y]);
  i=f[Y]+1;
  
  
     if(i<l[Y])for(;i<l[Y];i++)inter+=(lp(i)+365);
     j=0;
     while(j<l[M]-1){dl+=mth[j];j++;}
     dl+=l[D];
     if(leap[1]==1&&l[M]>2)dl++;
     j=0;
     while(j<f[M]-1){df+=mth[j];j++;}
     df+=f[D];
     if(leap[0]==1&&l[M]>2)df++;
   if(f[Y]<=l[Y]){  
    df2=365+leap[0]-df;
     dn=df2+dl+inter;}
 

  if(l[Y]==f[Y])dn=dl-df;

  printf("%d",dn);
}
int lp(int y)
{
  return (y%4==0&&y%100!=0)||(y%400==0);
}
main()
{int y1,y2,m1,m2,d1,d2,y,d,m,c,b,e,f,g,h;
 scanf("%d %d %d",&y1,&m1,&d1);
 scanf("%d %d %d",&y2,&m2,&d2);
 int a[13]={0};f=0;b=0;c=0;
 a[1]=31;a[3]=31;a[5]=31;a[7]=31;a[8]=31;a[10]=31;a[12]=31;
 a[4]=30;a[6]=30;a[9]=30;a[11]=30;
y=y1;m=1;d=1;
if (y%4!=0) a[2]=28;else if (y%100!=0) a[2]=29; else if (y%400!=0) a[2]=28; else a[2]=29;
while(m<m1){
b=b+a[m];m=m+1;}
while(d<d1){
b=b+1;d=d+1;}
m=1;d=1;
while(m<m2){
c=c+a[m];m=m+1;}
while(d<d2){
c=c+1;d=d+1;}f=c-b;y=y1;
while (y<y2)
{
e=y+1;if (m<2) {if (y%4!=0) g=365;else if (y%100!=0) g=366; else if (y%400!=0) g=365; else g=366;} else if (e%4!=0) g=365;else if (e%100!=0) g=366; else if (e%400!=0) g=365; else g=366;y=y+1;f=f+g;
}
printf("%d",f);
return 0;
}
int mon[12]={0,31,28,31,30,31,30,31,31,30,31,30};

int days(int a,int b,int c)
{
	int result=0,i;
    if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
		mon[2]=29;
	else
		mon[2]=28;
	for(i=1;i<b;i++)
		result+=mon[i];
    result+=c;
	return(result);
}

int main()
{
	int a1,b1,c1,a2,b2,c2,sum=0,temp,x;
	int i,j,year;

	scanf("%d%d%d%d%d%d",&a1,&b1,&c1,&a2,&b2,&c2);
	if(a1==a2)
	{
		x=days(a1,b2,c2)-days(a2,b1,c1);
		if(x<0)
			x=-x;
	}
	else
	{
    	if(a2<a1)
		{
		    temp=a1;
	    	a1=a2;
	    	a2=temp;
	    	temp=b1;
	    	b1=b2;
	    	b2=temp;
	    	temp=c1;
	    	c1=c2;
	    	c2=temp;
		}
        for(year=a1;year<a2;year++)
		{
	      	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
	    		sum+=366;
	    	else
		    	sum+=365;
		}
        x=sum+days(a2,b2,c2)-days(a1,b1,c1);
	}
	printf("%d",x);
	return;
}
int leapYear(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	return 0;
}
int main()
{
	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++)
		{
			switch (i)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12:count+=31;break;
				case 4:
				case 6:
				case 9:
				case 11:count+=30;break;
				case 2:
					if(leapYear(startYear))
						count+=29;
					else
						count+=28;
			}
		}
		for(i = 1; i < endMonth; i++)
		{
			switch (i)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12:count+=31;break;
				case 4:
				case 6:
				case 9:
				case 11:count+=30;break;
				case 2:
					if(leapYear(endYear))
						count+=29;
					else
						count+=28;
			}
		}
		switch (startMonth)
		{
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:count+=31;break;
			case 4:
			case 6:
			case 9:
			case 11:count+=30;break;
			case 2:
				if(leapYear(endYear))
					count+=29;
				else
					count+=28;
		}
		count += endDay - startDay;
	}else{
		for(i = startMonth + 1; i < endMonth; i++)
		{
			switch (i)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12:count+=31;break;
				case 4:
				case 6:
				case 9:
				case 11:count+=30;break;
				case 2:
					if(leapYear(startYear))
						count+=29;
					else
						count+=28;
			}
		}
		if(startMonth < endMonth)
		{
			switch (startMonth)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12:count+=31;break;
				case 4:
				case 6:
				case 9:
				case 11:count+=30;break;
				case 2:
					if(leapYear(endYear))
						count+=29;
					else
						count+=28;
			}
		}
		count += endDay - startDay;
	}
	for(i = startYear + 1;i < endYear; i++)
	{
		count += 365 + leapYear(i);
	}
	printf("%d",count);
	return 0;
}
int year1,month1,day1,year2,month2,day2;
int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
	int i,j,temp;
	int dis1,dis2,sum;
	scanf("%d%d%d",&year1,&month1,&day1);
	scanf("%d%d%d",&year2,&month2,&day2);
	int cmpa;
    int ru(int year);
	if (cmpa==0) 
	{
		temp=year1; year1=year2; year2=temp;
		temp=month1; month1=month2; month2=temp;
		temp=day1; day1=day2; day2=temp;
	}
	dis1=0;
	for (i=1; i<month1; i++)
	{
		if ((i==2)&&(ru(year1)==1)) dis1++;
		dis1=dis1+month[i];
	}
	dis1=dis1+day1;
	dis2=0;
    for (i=1; i<month2; i++)
	{
		if ((i==2)&&(ru(year2)==1)) dis2++;
		dis2=dis2+month[i];
	}
	dis2=dis2+day2;
	sum=dis2-dis1;
	for (i=year1; i<year2; i++)
		if (ru(i)==1) 
			sum=sum+366;
		else
			sum=sum+365;
	printf("%d",sum);
	return 0;
}

int cmpa()
{
	if (year1<year2) return(1);
	if (year1>year2) return(0);
	if (month1<month2) return (1);
	if (month1>month2) return(0);
	if (day1<day2) return (1);
	return(0);
}
int ru(int year)
{
	if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) return(1);
	else return(0);
}
int Year(int year)
{
	if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 366;
	return 365;
}
int main()
{
	int sy, sm, sd, ey, em, ed;
	int sum = 0, i, m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> sy >> sm >> sd >> ey >> em >> ed;
	for (i = sy; i <= ey; i++)
			sum += Year(i);
	for (i = 1; i < sm; i++)
		if (Year(sy) == 366 && i == 2)
			sum -= 29;
		else
			sum -= m[i];
	sum -= sd;
	for (i = 12; i > em; i--)
		if (Year(ey) == 366 && i == 2)
			sum -= 29;
		else
			sum -= m[i];
	if (Year(ey) == 366 && em == 2)
			sum -= 29 - ed;
	else
		sum -= m[em] - ed;
	cout << sum;
	return 0;
}
int main()
{
	int sy,sm,sd,ey,em,ed;
	int sum=0; 

	int k,f; //????????
	int m,d,a=0,b=0; //?????????

	int mon[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>>sy>>sm>>sd>>ey>>em>>ed;
	
	for (;sy<ey-1;sy++)
	{
		if (sm>2) k=( ( (sy+1) % 4 == 0 && (sy+1) % 100 != 0) || ((sy+1) % 400 == 0));
	    else k=( (sy % 4 == 0 && sy % 100 != 0) || (sy % 400 == 0));
        sum= sum+ year[k];
	} //??2008?2009???
	
	k= ((sy % 4 == 0 && sy % 100 != 0) || (sy % 400 == 0)); //??2008????
	
	if (sy<ey && (em>sm || (em==sm && ed>=sd))) //????2008 1 1 ?2009 2 1
	{
		sum= sum+year[k];
		sy++; //??2009 1 1?2009 2 1   //???2008 3 1?2009 1 1
	}
	
	k=( (sy % 4 == 0 && sy % 100 != 0) || (sy % 400 == 0) ); //??2009(2008)????
	f=( (ey % 4 == 0 && ey % 100 != 0) || (ey % 400 == 0) ); //??2009????
		
	d=sd;//??1 1 ?3 1 ??1 1???a
	for (m= sm; m>0; m--)
	{	
		for (; d>0; d--)
			a++;
		d= mon[k][m-2];
			
	}

	d=ed; //??2 1 ?1 1???b
	for (m= em;m>0;m--)
	{	
		for (; d>0; d--)
			b++;
		d= mon[f][m-2];
	}

	if (sy==ey ) sum= sum + b - a ; //2009 1 1?2009 2 1?b-a
	else sum= sum-a + year[k] +b; // 2008 3 1? 2009 1 1

	cout<<sum;

	return 0;
}
int year[2],month[2],day[2],i,days=0,k=0;
int main(void)
{
    scanf("%d%d%d",&year[0],&month[0],&day[0]);
    scanf("%d%d%d",&year[1],&month[1],&day[1]);
    for (i=year[0]+1;i<year[1];i++)
    {
        if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
        days+=366;
        else days+=365;
    }
    if (year[0]!=year[1])
    {
          for (i=month[0]+1;i<=12;i++)
             switch (i)
             {
              case 1:case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
              case 2:
                  if ((year[0] % 4 == 0 && year[0] % 100 != 0) || (year[0] % 400 == 0))
                     days+=29;
                     else days+=28;
                  break;
              default:days+=30;
             }
          for (i=1;i<=month[1]-1;i++)
             switch (i)
             {
              case 1:case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
              case 2:
                  if ((year[1] % 4 == 0 && year[1] % 100 != 0) || (year[1] % 400 == 0))
                     days+=29;
                     else days+=28;
                  break;
              default:days+=30;
             }
          for (k=0;k<2;k++)
              switch (month[k])
             {
              case 1:case 3:case 5:case 7:case 8:case 10:case 12:days+=(int)fabs(31*(int)fabs(k-1)-day[k]);break;
              case 2:
                  if ((year[k] % 4 == 0 && year[k] % 100 != 0) || (year[k] % 400 == 0))
                     days+=(int)fabs(29*(int)fabs(k-1)-day[k]);
                     else days+=(int)fabs(28*(int)fabs(k-1)-day[k]);
                  break;
              default:days+=(int)fabs(30*(int)fabs(k-1)-day[k]);
             }
    }
    else if (month[0]!=month[1])
           {
                    for (i=month[0]+1;i<=month[1]-1;i++)
                      switch (i)
                      {
                      case 1:case 3:case 5:case 7:case 8:case 10:case 12:days+=31;break;
                      case 2:
                      if ((year[1] % 4 == 0 && year[1] % 100 != 0) || (year[1] % 400 == 0))
                      days+=29;
                      else days+=28;
                      break;
                      default:days+=30;
                      }
                    for (k=0;k<2;k++)
                     switch (month[k])
                      {
                       case 1:case 3:case 5:case 7:case 8:case 10:case 12:days+=(int)fabs(31*(int)fabs(k-1)-day[k]);break;
                       case 2:
                        if ((year[k] % 4 == 0 && year[k] % 100 != 0) || (year[k] % 400 == 0))
                        days+=(int)fabs(29*(int)fabs(k-1)-day[k]);
                         else days+=(int)fabs(28*(int)fabs(k-1)-day[k]);
                        break;
                       default:days+=(int)fabs(30*(int)fabs(k-1)-day[k]);
                      }
           }
           else days+=day[1]-day[0];
    printf("%d",days);
    return 0;
}
int main()
{
	//int y[2]={365,366};
	int mon[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 y1,y2,m1,m2,d1,d2,a=0,i,t;
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	t=y1;
    while(t<y2)
	{
		if((t% 4 == 0 && t % 100 != 0)||(t% 400 == 0))
			a+=366;
		else a+=365;
		t++;
	}
	if((y1% 4 == 0 && y1 % 100 != 0) ||(y1% 400 == 0))
		for(i=0;i<m1-1;i++)//0 dai biao 1 yue
			a-=mon[1][i];
	else for(i=0;i<m1-1;i++)
		a-=mon[0][i];
    if((y2%4== 0 && y2% 100!= 0)||(y2% 400 == 0))
		for(i=0;i<m2-1;i++)//0 dai biao 1 yue
			a+=mon[1][i];
	else for(i=0;i<m2-1;i++)
		a+=mon[0][i];
	a=a+d2-d1;
	cout<<a;
   return 0;
}
int main()
{
	int a,b,c,x,y,z,i,year[3001];
	for(i=0;i<3001;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
			year[i]=366;
		else
			year[i]=365;
	}
	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}};
    cin>>a>>b>>c>>x>>y>>z;
	if(a==x)
	{
		int sum=0;    
        for(i=b;i<y;i++)
           sum=sum+month[(x%4==0&&x%100!=0)||(x%400==0)][i];
	    sum=sum+z-c;
	cout<<sum<<endl;
	}
	else
	{
	int sum=year[a];
	for(i=1;i<b;i++)
		sum=sum-month[(a%4==0&&a%100!=0)||(a%400==0)][i];
	sum=sum-c;
    for(i=a+1;i<x;i++)
		sum=sum+year[i];
	for(i=1;i<y;i++)
        sum=sum+month[(x%4==0&&x%100!=0)||(x%400==0)][i];
	sum=sum+z;
	cout<<sum<<endl;
	}
	return 0;
}
long int Jisuan(int year,int month,int day)
{
	long int Calnumber;
	Calnumber=year*365;
	int i,j=0;
	for(i=1;i<year;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
			j++;
	}
	Calnumber=Calnumber+j;
	int daysinFeb;
	if((year%4==0&&year%100!=0)||(year%400==0))
		daysinFeb=29;
	else
		daysinFeb=28;
	switch(month)
	{
	case 1:Calnumber+=0;
		break;
	case 2:Calnumber+=31;
		break;
	case 3:Calnumber+=31+daysinFeb;
		break;
	case 4:Calnumber+=31+31+daysinFeb;
		break;
	case 5:Calnumber+=31+31+30+daysinFeb;
		break;
	case 6:Calnumber+=31+31+30+31+daysinFeb;
		break;
	case 7:Calnumber+=31+31+31+30+30+daysinFeb;
		break;
	case 8:Calnumber+=31+31+31+31+30+30+daysinFeb;
		break;
	case 9:Calnumber+=31+31+31+31+31+30+30+daysinFeb;
		break;
	case 10:Calnumber+=31+31+31+31+31+30+30+30+daysinFeb;
		break;
	case 11:Calnumber+=31+31+3+31+31+31+30+30+30+daysinFeb;
		break;
	case 12:Calnumber+=365-28-31+daysinFeb;
		break;
	}
	Calnumber+=day;
	return(Calnumber);
}
int main()
{
	int y1,y2,m1,m2,d1,d2;
	scanf("%d %d %d\n%d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
	long int Cal1,Cal2;
	Cal1=Jisuan(y1,m1,d1);
	Cal2=Jisuan(y2,m2,d2);
	int Con;
	Con=Cal2-Cal1;
	printf("%d",Con);
	return 0;
}
void main()
{
int startyear,startmonth,startday,endyear,endmonth,endday,i,j,s,t,result,n=0,m=0;
scanf("%d %d %d\n%d %d %d",&startyear,&startmonth,&startday,&endyear,&endmonth,&endday);
for(i=1;i<=startmonth-1;i++)
{
if(i==1||i==3||i==5||i==7||i==8||i==10)
n=n+31;
else if(i==2)
{
if((startyear%4==0&&startyear%100!=0)||(startyear%400==0))
n=n+29;
else
n=n+28;
}
else
n=n+30;
}
for(j=1800;j<=startyear-1;j++)
{
if((j%4==0&&j%100!=0)||(j%400==0))
n=n+366;
else
n=n+365;
}
n=n+startday;
for(s=1;s<=endmonth-1;s++)
{
if(s==1||s==3||s==5||s==7||s==8||s==10)
m=m+31;
else if(s==2)
{
if((endyear%4==0&&endyear%100!=0)||(endyear%400==0))
m=m+29;
else
m=m+28;
}
else
m=m+30;
}
for(t=1800;t<=endyear-1;t++)
{
if((t%4==0&&t%100!=0)||(t%400==0))
m=m+366;
else
m=m+365;
}
m=m+endday;
result=m-n;
printf("%d",result);
}
int star[3],end[3],sum=0;
int month1[13]={0,31,60,91,121,152,182,213,244,274,305,335,366};
int month2[13]={0,31,59,90,120,151,181,212,243,273,304,334,365};
int countday(int ch1[3],int ch2[3]);
int countmonth(int ch1[3],int ch2[3]);
int countyear(int ch1[3],int ch2[3]);
int countday(int ch1[3],int ch2[3])

{
	sum=sum-ch1[2]+ch2[2];
	countmonth(star,end);

	return(sum);
}
int countmonth(int ch1[3],int ch2[3])
{
	if((ch1[0]%4==0&&ch1[0]%100!=0)||(ch1[0]%400==0))
	{
		if((ch2[0]%4==0&&ch2[0]%100!=0)||(ch2[0]%400==0))
		{
			sum=sum-month1[ch1[1]-1]+month1[ch2[1]-1];
		}
		else
		{
			sum=sum-month1[ch1[1]-1]+month2[ch2[1]-1];
			
		}
	}
	else
	{
		if((ch2[0]%4==0&&ch2[0]%100!=0)||(ch2[0]%400==0))
		{
			sum=sum-month2[ch1[1]-1]+month1[ch2[1]-1];
		}
		else
		{
			sum=sum-month2[ch1[1]-1]+month2[ch2[1]-1];


		}
	}
	countyear(star,end);
	return(sum);
}



int countyear(int ch1[3],int ch2[3])
{
	while (ch1[0]<ch2[0])
		{
			if((ch1[0]%4==0&&ch1[0]%100!=0)||(ch1[0]%400==0))
				sum=sum+366;
			else
				sum=sum+365;
			ch1[0]++;
		}
		return(sum);
}



void main()
{
	int i,j;
	for(i=0;i<3;i++)
		scanf("%d",&star[i]);
	for(j=0;j<3;j++)
		scanf("%d",&end[j]);
	countday(star,end);
	printf("%d\n",sum);
}
int main()
{
	int sy, sm, sd;
	int ey, em, ed;
	int i ,day = 0, d1 = 0, d2 = 0;
	cin >> sy >> sm >> sd >> ey >> em >> ed;
	for(i = sy; i < ey; i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			day += 366;
		else
			day += 365;
	}
	for(i = 1; i < sm; i++)
	{
		if(i == 2)
		{
			if((sy % 4 == 0 && sy % 100 != 0) || (sy % 400 == 0))
				d1 += 29;
			else
				d1 += 28;
		}
		else if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)
			d1 += 31;
		else
			d1 += 30;
	}
	d1 += sd;
	for(i = 1; i < em; i++)
	{
		if(i == 2)
		{
			if((ey % 4 == 0 && ey % 100 != 0) || (ey % 400 == 0))
				d2 += 29;
			else
				d2 += 28;
		}
		else if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)
			d2 += 31;
		else
			d2 += 30;
	}
	d2 += ed;
	day = day - d1 + d2;
	cout << day << endl;




	return 0;
}
int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};  
int leap_days[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};  
int isLeapYear(int year)  
{  
     return year % 400 == 0 || year % 4 == 0 && year % 100 != 0;  
 }  
 //????????(day,month)?????   
 int sumFromFirstDay(int year, int month, int day)  
{  
    int i, ret = day;  
    for (i = 1; i < month; i++)  
        if (isLeapYear(year)) ret = ret + leap_days[i];  
        else ret = ret + days[i];  
    return ret;  
}  
 int main()  
 {  
     int startYear, startMonth, startDay;  
    int endYear, endMonth, endDay;  
    scanf("%d%d%d", &startYear, &startMonth, &startDay);  
    scanf("%d%d%d", &endYear, &endMonth, &endDay);         
     int i, sum = 0;  
    for (i = startYear + 1; i < endYear; i++)  
        sum += isLeapYear(i) ? 366 : 365;  
    int start = sumFromFirstDay(startYear, startMonth, startDay);  
    int end = sumFromFirstDay(endYear, endMonth, endDay);  
  if (startYear == endYear) sum += end - start;  
   else 
   {  
        sum += (365 - start) + end;  
       if (isLeapYear(startYear)) sum++;  
     } 
    printf("%d",sum);  
   return 0;  
 }
int main()
{
	int s1[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int s2[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
	int y1, y2, m1, m2, d1, d2, flag, sum=0, i;
	cin >> y1 >> m1 >> d1;
	cin >> y2 >> m2 >> d2;
	for(i=y1+1;i<y2;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			sum+=366;
		else
			sum+=365;
	}
	if(y1<y2)
	{
		flag = 0;
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
			flag = 1;
		for(i=m1-1;i<12;i++)
		{
			if(flag)
				sum+=s2[i];
			else
				sum+=s1[i];
		}
		sum-=d1;

		flag = 0;
		if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
			flag = 1;

		for(i=0;i<m2-1;i++)
		{
			if(flag)
				sum+=s2[i];
			else
				sum+=s1[i];
		}
		sum+=d2;
	}
	else
	{
		flag = 0;
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
			flag = 1;
		for(i=m1-1;i<m2-1;i++)
		{
			if(flag)
				sum+=s2[i];
			else
				sum+=s1[i];
		}
		sum = sum - d1 + d2;
	}
	cout << sum << endl;
	return 0;


}
int judge(int);
int main()
{
	int mon1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int mon2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int year1, year2, month1, month2, day1, day2, i, j, sum = 0;
	cin >> year1 >> month1 >> day1 >> year2 >> month2 >> day2;
	for(i = year1; i < year2; i++)
	{
		if(judge(i))
			sum += 366;
		else
			sum += 365;
	}
		if(judge(year2))
			for(j = 1; j < month2; j++)
				sum += mon2[j];
		else
			for(j = 1; j < month2; j++)
				sum += mon1[j];
		sum += day2;
		if(judge(year1))
		{
			for(j = 1; j < month1; j++)
				sum -= mon2[j];
			sum -= day1;
		}
		else
		{
			for(j = 1; j < month1; j++)
				sum -= mon1[j];
			sum -= day1;
		}
		cout << sum;
	return 0;
}
int judge(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	else
		return 0;
}
main()
{
	int y1,y2,y3,m1,m2,m3,d1,d2,d3,n,i,j=0;
	int a[14]={0,0,31,59,90,120,151,181,212,243,273,304,334,365},b[14]={0,0,31,60,91,121,152,182,213,244,274,305,335,366};
	scanf("%d %d %d",&y1,&m1,&d1);
	scanf("%d %d %d",&y2,&m2,&d2);
	if(y1>y2||y1==y2&&m1>m2||y1==y2&&m1==m2&&d1>d2)
	{
		y3=y1;
		y1=y2;
		y2=y3;
		m3=m1;
		m1=m2;
		m2=m3;
		d3=d1;
		d1=d2;
		d2=d3;
	}
	for(i=y1+1;i<y2;i++)
	{
		if(i%100!=0&&i%4==0||i%400==0)
			j++;
	}
	if(y1==y2)
	{
		if(m1==m2)
			n=d2-d1;
		if(m2>m1)
			n=a[m2]-a[m1]+d2-d1;
		if((y1%100!=0&&y1%4==0||y1%400==0)&&(m1<2&&m2>2||m1==2&&d1<29&&m2>2))
			n=n+1;
	}
	if(y2-y1==1)
	{
		n=365-a[m1]-d1+a[m2]+d2;
		if((y1%100!=0&&y1%4==0||y1%400==0)&&(a[m1]+d1)<60||(y2%100!=0&&y2%4==0||y2%400==0)&&(a[m2]+d2)>=60)
			n=n+1;
	}
	if(y2-y1>=2)
	{
		n=365-a[m1]-d1+a[m2]+d2+(y2-y1-1)*365+j;
		if((y1%100!=0&&y1%4==0||y1%400==0)&&(a[m1]+d1)<60||(y2%100!=0&&y2%4==0||y2%400==0)&&(a[m2]+d2)>=60)
			n=n+1;
	}
	printf("%d\n",n);
}
void main()
{
	int f(int y,int m,int d);
	int y1,y2,m1,m2,d1,d2,s1,s2;
	scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
	s1=f(y1,m1,d1);
	s2=f(y2,m2,d2);
	printf("%d",s2-s1);
}
int f(int y,int m,int d)
{	int i,s=0;
	for(i=1;i<y;i++)
	{if((i%4==0&&i%100!=0)||(i%400==0))
	s=s+366;
	else s=s+365;
	}
	for(i=1;i<m;i++)
	{if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
	s=s+31;
	else
	{if(i==2)
	{if((y%4==0&&y%100!=0)||(y%400==0))
	s=s+29;
	else s=s+28;}
	else s=s+30;}
	}
	s=s+d;
	return(s);
}
int main()
{
    long int x[2][4];
    int i,y,m,d,minus;
    for(i=0;i<=1;i++)
    {
                scanf("%d%d%d",&x[i][0],&x[i][1],&x[i][2]);    
                y=x[i][0];
                m=x[i][1];
                d=x[i][2];
            if(y%4==0&&y%100!=0||y%400==0)
            {
                                                  if(m<=2)    x[i][3]=(y-1)/4*1461+(y-1)%4*365-(y-1)/100+(y-1)/400+(m-1)*31+d;
                                                  else if(m<=8) x[i][3]=(y-1)/4*1461+(y-1)%4*365-(y-1)/100+(y-1)/400+(m-1)/2*61+(m-1)%2*31-1+d;
                                                  else  x[i][3]=(y-1)/4*1461+(y-1)%4*365-(y-1)/100+(y-1)/400+213+(m-8)/2*61+(m-8)%2*31+d;
                                                      }
                                                      else 
                                                      {
                                                            if(m<=2)    x[i][3]=(y-1)/4*1461+(y-1)%4*365-(y-1)/100+(y-1)/400+(m-1)*31+d;
                                                  else if(m<=8) x[i][3]=(y-1)/4*1461+(y-1)%4*365-(y-1)/100+(y-1)/400+(m-1)/2*61+(m-1)%2*31-2+d;
                                                  else  x[i][3]=(y-1)/4*1461+(y-1)%4*365-(y-1)/100+(y-1)/400+212+(m-8)/2*61+(m-8)%2*31+d;
                                                           }
                     }
                     minus=abs(x[0][3]-x[1][3]);
                     printf("%d\n",minus);
return 0;
}
int lmonth[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int pmonth[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int days(int year,int m,int d){
	int day = 0;
	if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)){
		for (int i=1;i<=m-1;i++)
			day += lmonth[i];
	}
	else for (int i=1;i<=m-1;i++)
		day += pmonth[i];
	day += d;
	return day;
}

int main ()
{
	int y1,m1,d1,y2,m2,d2;
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	int sum = 0;
	for (int i=y1;i<=y2-1;i++){
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			sum += 366;
		else sum += 365;
	}
	sum -= days(y1,m1,d1);
	sum += days(y2,m2,d2);
	cout<<sum;
	return 0;
}
int main()
	{
		int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int i,x1,x2,x3,y1,y2,y3,d1=0,d2=0,d;
	scanf("%d %d %d\n%d %d %d",&x1,&x2,&x3,&y1,&y2,&y3);
	if((x1%4==0&&x1%100!=0)||(x1%400==0))
	day[2]=29;
	else
    day[2]=28;
	for(i=1;i<=(x2-1);i++)
	{d1=d1+day[i];}
	d1=d1+x3;
    if((y1%4== 0&&y1%100!=0)||(y1%400==0))
	day[2]=29;
	else
	day[2]=28;
    for(i=1;i<=(y2-1);i++)
	{d2=d2+day[i];}
	d2=d2+y3;
	for(i=1;i<=(x1-1);i++)
	{if((i%4==0&&i%100!=0)||(i%400==0))
	d1=d1+366;
	else
	d1=d1+365;}
  for(i=1;i<=(y1-1);i++)
	{if((i%4==0&&i%100!=0)||(i%400==0))
	d2=d2+366;
	else
	d2=d2+365;}
     if(d1>=d2)
      d=d1-d2;
      else
      d=d2-d1;
   printf("%d",d);
   return 0;
	}
int main()
{
	int y1,y2,m1,m2,d1,d2,i,sum=0;
	int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};//????
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	if(y1==y2) //????
	{
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
				month[1]+=1; //???2?29?
		for(i=m1;i<m2-1;i++)
		{
			sum+=month[i];
		}
		if(m1==m2) sum+=d2-d1;
		else
		{
			sum+=month[m1-1]-d1;
			sum+=d2;
		}
	}
	else //?????
	{
		for(i=m1;i<12;i++)//?????
		{
			sum+=month[i];
			if(i==1&&((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0)))
				sum+=1;
		}
		sum+=month[m1-1]-d1; 
		for(i=0;i<m2-1;i++) //??????
		{
			sum+=month[i];
			if(i==1&&((y2% 4 == 0 && y2 % 100 != 0) || (y2% 400 == 0)))
				sum+=1;
		}
		sum+=d2;
		for(i=y1+1;i<y2;i++) //???????
		{
			if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
				sum+=366;
			else sum+=365;
		}
	}
	cout<<sum;
	return 0;
}