semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a=0,m;
	int Ori[2][3];
	scanf("%d %d %d",&Ori[0][0],&Ori[0][1],&Ori[0][2]);
	scanf("%d %d %d",&Ori[1][0],&Ori[1][1],&Ori[1][2]);
	int sy,sm=Ori[0][1],ey=Ori[1][0],em=Ori[1][1];
	for(sy=Ori[0][0];sy<Ori[1][0];sy++){
		if(Ori[0][1]<=2){
	    if((sy%4==0&&sy%100!=0)||(sy%100==0&&sy%400==0)) a+=366;
		else a+=365;
		}
		else{
		if(((sy+1)%4==0&&(sy+1)%100!=0)||((sy+1)%100==0&&(sy+1)%400==0)) a+=366;
		else a+=365;
		}
	}
	int D[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	if((Ori[0][1]<Ori[1][1])||(Ori[0][1]==Ori[1][1]&&Ori[0][2]<Ori[1][2])){
		if(Ori[0][1]!=Ori[1][1]){
			for(m=1;m<=12;m++){
				if(m==sm&&m<Ori[1][1]){
				    a+=D[m-1];
					sm++;
				}
			}
		}
	a+=(Ori[1][2]-Ori[0][2]);
	if(((ey%4==0&&ey%100!=0)||(ey%100==0&&ey%400==0))&&(Ori[0][1]<=2&&Ori[1][1]>2)) a+=1;
	printf("%d",a);
    }
	else{
		if(Ori[0][1]!=Ori[1][1]){
			for(m=1;m<=12;m++){
				if(m==em&&m<Ori[0][1]){
				    a-=D[m-1];
					em++;
				}
			}
		}
	a-=(Ori[0][2]-Ori[1][2]);
	if(((ey%4==0&&ey%100!=0)||(ey%100==0&&ey%400==0))&&(Ori[1][1]<=2&&Ori[0][1]>2)) a-=1;
	printf("%d",a);
	}
    return 0;
}
int main()
{
	int i,j,year[2],month[2],day[2];
	int mon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	for(i=0;i<2;i++)
		cin>>year[i]>>month[i]>>day[i];
	int sum=0;
	for(i=year[0];i<year[1];i++)
	{
		sum+=365;
		if(i%4==0&&i%100!=0||i%400==0)
			sum++;
	}
	for(i=1;i<month[1];i++)
		sum+=mon[i];
	for(i=1;i<month[0];i++)
		sum-=mon[i];
	sum+=day[1];
	sum-=day[0];
	if((year[1]%4==0&&year[1]%100!=0||year[1]%400==0)&&month[1]>2)sum++;
	if((year[0]%4==0&&year[0]%100!=0||year[0]%400==0)&&month[0]>2)sum--;
	cout<<sum<<endl;
	return 0;
}
int m[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int suan(int h, int d)
{
	int i;
	if(h == 1)
		return d;
	else
	{
		for(i = 1; i < h; i++)
			d += m[i];
		return d;
	}
}
int main()
{
	int a1,a2,b1,b2,c1,c2;
	int sum = 0;
	cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
	int i;
	if((a2 % 4 == 0 && a2 % 100 != 0) || a2 % 400 == 0)
	m[2] = 29;
	sum += suan(b2, c2);
	m[2] = 28;
	if((a1 % 4 == 0 && a1 % 100 != 0) || a1 % 400 == 0)
	m[2] = 29;
	sum -= suan(b1, c1);
	if(a1 == a2)
		cout << sum;
	else
	{
		for(i = a1; i < a2; i++)
		{
			if((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
				sum += 366;
			else
				sum +=365;
		}
		cout << sum;
	}
	return 0;
}
int main()
{
	int f1(int,int,int);
	int f2(int,int);
	int y1,y2,m1,m2,d1,d2,s;
	scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
	s=f1(y2,m2,d2)-f1(y1,m1,d1)+f2(y1,y2);
	printf("%d",s);
}
int f1(int y,int m,int d)
{
	int a,b,f;
	a=(y%4==0&&y%100!=0)||(y%400==0);
	b=(m>2);
	if(m==1) f=d-1;
	if(m==2) f=d+30;
	if(m==3) f=d+58;
	if(m==4) f=d+89;	
	if(m==5) f=d+119;
	if(m==6) f=d+150;
	if(m==7) f=d+180;
	if(m==8) f=d+211;
	if(m==9) f=d+242;
	if(m==10) f=d+272;
	if(m==11) f=d+303;
	if(m==12)f=d+333;
	f=f+a*b;
    return f;
}
int f2(int year1,int year2)
{
	int f=0,i;
	for(i=year1;i<year2;i++)
		f+=(i%4==0&&i%100!=0)||(i%400==0);
	f+=365*(year2-year1);
	return f;
}
/*
 * 5.cpp
 *
 *  Created on: 2011-11-4
 *      Author: 11132
 */

int main()
{
   int y1,m1,d1,y2,m2,d2,t1,t2,n,i,p=0;
   cin>>y1>>m1>>d1;
   cin>>y2>>m2>>d2;

   if((y1%4==0)&&(y1%100!=0)||(y1%400==0))
   {switch(m1)
   {
   case 1:t1=d1;break;
   case 2:t1=31+d1;break;
   case 3:t1=59+d1+1;break;
   case 4:t1=90+d1+1;break;
   case 5:t1=120+d1+1;break;
   case 6:t1=151+d1+1;break;
   case 7:t1=181+d1+1;break;
   case 8:t1=212+d1+1;break;
   case 9:t1=243+d1+1;break;
   case 10:t1=273+d1+1;break;
   case 11:t1=304+d1+1;break;
   case 12:t1=334+d1+1;break;
   }
   t1=366-t1;}
   else
   {switch(m1)
   {
   case 1:t1=d1;break;
   case 2:t1=31+d1;break;
   case 3:t1=59+d1;break;
   case 4:t1=90+d1;break;
   case 5:t1=120+d1;break;
   case 6:t1=151+d1;break;
   case 7:t1=181+d1;break;
   case 8:t1=212+d1;break;
   case 9:t1=243+d1;break;
   case 10:t1=273+d1;break;
   case 11:t1=304+d1;break;
   case 12:t1=334+d1;break;
   }
   t1=365-t1;}

   if((y2%4==0)&&(y2%100!=0)||(y2%400==0))
   {switch(m2)
   {
   case 1:t2=d1;break;
   case 2:t2=31+d2;break;
   case 3:t2=59+d2+1;break;
   case 4:t2=90+d2+1;break;
   case 5:t2=120+d2+1;break;
   case 6:t2=151+d2+1;break;
   case 7:t2=181+d2+1;break;
   case 8:t2=212+d2+1;break;
   case 9:t2=243+d2+1;break;
   case 10:t2=273+d2+1;break;
   case 11:t2=304+d2+1;break;
   case 12:t2=334+d2+1;break;
   }}
   else
   {switch(m2)
   {
   case 1:t2=d2;break;
   case 2:t2=31+d2;break;
   case 3:t2=59+d2;break;
   case 4:t2=90+d2;break;
   case 5:t2=120+d2;break;
   case 6:t2=151+d2;break;
   case 7:t2=181+d2;break;
   case 8:t2=212+d2;break;
   case 9:t2=243+d2;break;
   case 10:t2=273+d2;break;
   case 11:t2=304+d2;break;
   case 12:t2=334+d2;break;
   }}
   if(y1==y2) p=0;
   else if(y1+1==y2) p=0;
   else
   {for(i=y1+1;i<y2;i++)
   {
	   if((i%4==0)&&(i%100!=0)||(i%400==0))
	   {
		   p=p+1;
	   }
   }}
   n=t1+t2+365*(y2-y1-1)+p;
   cout<<n<<endl;
   return 0;
}
int main()
{
	int f(int x,int y,int z);
	int year1,year2,month1,month2,day1,day2,sum=0,i,d1,d2;
	scanf("%d %d %d\n%d %d %d",&year1,&month1,&day1,&year2,&month2,&day2);
	for(i=year1;i<year2;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400)==0)
			sum=sum+366;
		else sum=sum+365;
	}
	d1=f(year1,month1,day1);
	d2=f(year2,month2,day2);
	sum=sum+(d2-d1);
	printf("%d\n",sum);
	return 0;
}
int f(int x,int y,int z)
{
	int p=0,i;
	for(i=1;i<y;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			p=p+31;
		else if(i==4||i==6||i==9||i==11)
			p=p+30;
		if(i==2)
		{
			if((x%4==0&&x%100!=0)||(x%400)==0)
				p=p+29;
			else p=p+28;
		}
	}
	p=p+z;
	return p;
}
int main(){
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int year1=0,month1=0,day1=0,year2=0,month2=0,day2=0;
	int i=0,total=0;
	cin>>year1>>month1>>day1;
	cin>>year2>>month2>>day2;
	for(i=year1;i<year2;i++){
		if((i%4==0&&i%100!=0)||(i%400==0))
			total=total+366;
		else
			total=total+365;
	}
	if((year1%4==0&&year1%100!=0)||(year1%400==0)){
		a[1]=29;
		for(i=0;i<month1-1;i++)
			total=total-a[i];
		total=total-day1;
	}
	else{
		a[1]=28;
		for(i=0;i<month1-1;i++)
			total=total-a[i];
		total=total-day1;
	}
	if((year2%4==0&&year2%100!=0)||(year2%400==0)){
		a[1]=29;
		for(i=0;i<month2-1;i++)
			total=total+a[i];
		total=total+day2;
	}
	else{
		a[1]=28;
		for(i=0;i<month2-1;i++)
			total=total+a[i];
		total=total+day2;
	}
	cout<<total<<endl;
	return 0;
}
void main()
{
    int sum=0,y1,m1,d1,y2,m2,d2,m,month;
    scanf("%d%d%d\n%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
    for(;y1<y2;y1++)
    {
        if((y1%4==0&&y1%100!=0)||(y1%400==0))sum+=366;
        else sum+=365;
    }
    if(m1>m2)
    {
        m1=m1-1;
        for(;m1>=m2;m1--)
        {
            switch(m1)
            {
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:month=31;break;
                case 4:
                case 6:
                case 9:
                case 11:month=30;break;
                case 2:
                {
                    if(y2%4==0&&y2%400!=0||y2%400==0)month=28;
                    else month=29;
                }
            }
            sum=sum-month;
        }
    }
    else if(m1<m2)
    {
        for(;m1<m2;m1++)
        {
            switch(m1)
            {
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:month=31;break;
                case 4:
                case 6:
                case 9:
                case 11:month=30;break;
                case 2:
                {
                    if((y2%4==0&&y2%400!=0)||(y2%400==0))month=29;
                    else month=28;
                }
            }
            sum+=month;
        }
    }
    sum=sum+d2-d1;
    printf("%d",sum);
}
void main()
{
	int a[3];
	int b[3];
	int t;
	int year(int a[],int b[]);
	int month(int a[],int b[]);
	scanf("%d %d %d",&a[0],&a[1],&a[2]);
    scanf("%d %d %d",&b[0],&b[1],&b[2]);
	t=0;
    if(b[0]>=a[0])
		t=t+year(a,b);
	else t=-1000;
	if(b[1]>a[1])
		t=t+month(a,b);
	else t=t-month(a,b);
	t=t+b[2]-a[2];
	if(t<0)
		printf("wrong input");
	else printf("%d",t);
}
int year(int a[],int b[])
{
	int i,m;
	m=0;
	for(i=a[0];i<b[0];i++)
	{
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
			m=m+366;
		else m=m+365;
	}
	return (m);
}
int month(int a[],int b[])
{
	int i,m,c[12],x,y;
	m=0;
	for(i=0;i<=11;i++)
	{
		switch(i)
		{
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12: c[i]=31;break;
			case 2: c[i]=28;break;
			default: c[i]=30;
		}
	}
	x=(a[1]>b[1])? a[1]:b[1];
	y=(a[1]<b[1])? a[1]:b[1];
		for(i=y;i<x;i++)
			m=m+c[i];
		if(y<=2&&x>2)
			if(((b[0]%4==0)&&(b[0]%100!=0))||(b[0]%400==0))
				m++;
		return (m);
}
int tian(int, int, int);
int g_a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int g_b[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main()
{
	int y1, y2, m1, m2, d1, d2;
	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	
	int sum1 = 0, sum2 = 0;
	sum1 = tian(y1, m1, d1);
	sum2 = tian(y2, m2, d2);
	cout<<sum2 - sum1<<endl;
	return 0;
}
int tian(int y, int m, int d)
{
	int i, sum = 0;
	for (i = 1; i < y; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			sum +=366;
		else
			sum += 365;
	}
	for (i = 1; i < m; i++)
	{
		if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))
			sum += g_b[i];
		else
			sum += g_a[i];
	}
	sum += d;
	return sum;
}
int year[2]={365,366};
int month[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 main()
{
    int y1,m1,d1,y2,m2,d2;
    cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
    int ans=0;
    while(y1!=y2 || m1!=m2 || d1!=d2)
    {
           ans++;
           d1++;
           int leapyear=((y1%4==0&&y1%100!=0) || y1%400==0);
           if(d1>month[leapyear][m1-1])
            { d1=1; m1++;}
           if(m1>12) 
           { m1=1;y1++;}
    }
    cout<<ans<<endl;
    return 0;
}
int main ()
{
	int Day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int year1,year2,month1,month2,day1,day2,days=0;
	cin >> year1 >>month1 >> day1 >> year2 >> month2 >> day2;
	while (year1!=year2)
	{
		if( (year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0))
			Day[1]=29;
		days+=Day[month1-1];
		month1++;
		if (month1==13)
		{
			year1++;
			month1=1;
			Day[1]=28;
		}
	}
	while (month1!=month2)
	{
		if( (year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0))
			Day[1]=29;
		days+=Day[month1-1];
		month1++;
	}
	days+=day2;
	days-=day1;
	cout << days << endl;
	return 0;
}
int RY(int year)
{
	int k;
	if (year%4==0)
	{
		if (year%100==0)
		{
		if (year%400==0) k=1;
		else k=0;
		}
		else k=1;
	}
	else k=0;
	return (k);
}
int NO(int a,int b,int c)
{
	int NO,i,j;
	NO=0;
	for(i=0;i<a;i++)
	{
		if (RY(i)==1) NO=NO+366;
		else NO=NO+365;
	}
	for(j=1
		;j<b;j++)
	{
		if (j==1||j==3||j==5||j==7||j==8||j==10||j==12)NO=NO+31;
		else if(j==4||j==6||j==9||j==11)NO=NO+30;
		else if(RY(a)==1)NO=NO+29;
		else NO=NO+28;
	}
	NO=NO+c;
	return (NO);
}
void main()
{
	int a1,b1,c1,a2,b2,c2,x,y,z;
	scanf("%d%d%d",&a1,&b1,&c1);
	scanf("%d%d%d",&a2,&b2,&c2);
	x=NO(a1,b1,c1);
	y=NO(a2,b2,c2);
	z=y-x;
	printf("%d",z);
}
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 leap(int a)
{
	if ((a%4==0&&a%100!= 0)||(a%400==0))
		return 1;
	else 
		return 0;
}
int year[2]={365,366};
int month [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 main()
{
	int y1,m1,d1;
	cin>>y1>>m1>>d1;
	int y2,m2,d2;
	cin>>y2>>m2>>d2;
	int day=0,i;
	for (i=y1+1;i<y2;i++)
	{
		day=day+year[leap(i)];
	}
	if (y1<y2)
	{
	for (i=m1;i<12;i++)
		day=day+month[leap(y1)][i];
	for (i=0;i<m2-1;i++)
		day=day+month[leap(y2)][i];
	day=day+31-d1;
	day=day+d2;
	}
	else if (y1==y2)
	{
		for (i=m1;i<m2-1;i++)
			day=day+month[leap(y1)][i];
		day=day+d2-d1;
	}
	cout<<day;
}
int main()
{
	int sum = 0; 
	int y1, y2, d1, d2, m1, m2;
	int i,j;
	int u1[13]={0,31,29,31,30,31,30,31,31,30,31,30,31},u2[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin >> y1 >> m1 >> d1;
	cin >> y2 >> m2 >> d2;
	for (i = y1; i < y2; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
		{
			sum += 366;
		}
		else
			sum += 365;
		//cout << i << endl;
	}
	//cout << sum << endl;
	if ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
	{
		for (j = 1; j < m1; j++)
		{
			sum -= u1[j];
		}
		sum -= d1;
	}
	else
	{
		for (j = 1; j < m1; j++)
		{
			sum -= u2[j];
		}
		sum -= d1;
	}//cout << sum << endl;
	if ((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
	{
		for (j = 1; j < m2; j++)
		{
			sum += u1[j];
		}
		sum += d2;
	}
	else
	{
		for (j = 1; j < m2; j++)
		{
			sum += u2[j];
		}
		sum += d2;
	}

	cout << sum << endl;
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;
}
int  NO[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int  SP[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int boolean(int year)
{
	if  ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) return 1 ;
	   else return 0;
}
void main()
{
	long i,sum,y1,m1,d1,y2,m2,d2;
	scanf("%d%d%d",&y1,&m1,&d1);
	scanf("%d%d%d",&y2,&m2,&d2);
	sum=0;
	for (i=1;i<=m1-1;i++)
		if (boolean(y1)==1)
	      sum=sum-NO[i];
		else sum=sum-SP[i];
	sum=sum-d1;
	for (i=1;i<=m2-1;i++)
	  if (boolean(y2)==1)
	      sum=sum+NO[i];
		else sum=sum+SP[i];
	sum=sum+d2;
	for (i=y1;i<=y2-1;i++)
		if (boolean(i)==1) sum=sum+366;
		else sum=sum+365;
	printf("%ld\n",sum);
}
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};
int x[2],y[2],z[2],s=0,m,i;
scanf("%d %d %d\n",&x[0],&y[0],&z[0]);
scanf("%d %d %d\n",&x[1],&y[1],&z[1]);
m=x[0];
if(x[0]<x[1])
{for(;x[0]<x[1];x[0]++)
{if(x[0]%4==0&&x[0]%100!=0||x[0]%400==0)
s=s+366;
else
	s=s+365;
}}
if(m%4==0&&m%100!=0||m%400==0)
{for(i=0;i<y[0]-1;i++)
s=s-b[i];}
else
	{for(i=0;i<y[0]-1;i++)
{s=s-a[i];}}
	s=s-z[0];
	if(x[1]%4==0&&x[1]%100!=0||x[1]%400==0)
	{for(i=0;i<y[1]-1;i++)
	s=s+b[i];}
	else
		{for(i=0;i<y[1]-1;i++)
		s=s+a[i];}
	s=s+z[1];
	printf("%d",s);
}
int main(){
	int year1,year2,month1,month2,day1,day2,n=0;
	int i,j,k;
	scanf("%d%d%d%d%d%d",&year1,&month1,&day1,&year2,&month2,&day2);
	for(i=year1;i<year2;i++){
		if(i%4!=0||(i%100==0&&i%400!=0))
			n+=365;
		else
			n+=366;
	}
	for(j=1;j<month1;j++){
		if(j==1||j==3||j==5||j==7||j==8||j==10)
			n-=31;
		else if(j!=2)
			n-=30;
		else if(year2%4!=0||(year2%100==0&&year2%400!=0))
			n-=28;
		else
			n-=29;
	}
	n-=day1;
	for(k=1;k<month2;k++){
		if(k==1||k==3||k==5||k==7||k==8||k==10)
			n+=31;
		else if(k!=2)
			n+=30;
		else if(year2%4!=0||(year2%100==0&&year2%400!=0))
			n+=28;
		else
			n+=29;
	}
	n+=day2;
	printf("%d",n);
	return 0;
}
int main()
{
	int y1, y2, m1, m2, d1, d2;
	int i, j, sum = 0;
	int month[13] = {0, 31,28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> y1 >> m1 >> d1;
	cin >> y2 >> m2 >> d2;
	if (y1 == y2 && m1 == m2)
	{
		cout << d2 - d1 << endl;
		return 1;
	}
	else if (y1 == y2)
	{
		if ((y1 % 4 == 0 && y1 % 100 != 0) || y1 % 400 == 0)
			month[2] = 29;
		else
			month[2] = 28;
		sum += month[m1] - d1;
		if (m2 == m1 + 1)
			sum += d2;
		else
		{
			for (i = m1 + 1; i < m2; i++)
				sum += month[i];
			sum += d2;
		}
		cout << sum << endl;
	}
	else
	{
		for (i = y1; i <= y2; i++)
		{
			if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
				month[2] = 29;
			else
				month[2] = 28;
			if (i == y1)
			{
				for (j = m1; j <= 12; j++)
				{
					if (j == m1)
						sum += month[m1] - d1;
					else
						sum += month[j];
				}
			}
			else if (i == y2)
			{
				for (j = 1; j <= m2; j++)
				{
					if (j != m2)
						sum += month[j];
					else
						sum += d2;
				}
			}
			else
			{
				if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
					sum += 366;
				else
					sum += 365;
			}
		}
		cout << sum << endl;
	}
	return 0;
}
int dayfr(int m,int d)
{
int t;
int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
t=a[m-1]-d;
for (m=m+1;m<=12;m++)
{
t=t+a[m-1];
}
return (t);
}
int dayr(int m,int d)
{
int t;
int a[12]={31,29,31,30,31,30,31,31,30,31,30,31};
t=a[m-1]-d;
for (m=m+1;m<=12;m++)
{
t=t+a[m-1];
}
return (t);
}
void main()
{
 int y1,m1,d1,y2,m2,d2,year,t;
 scanf ("%d%d%d",&y1,&m1,&d1);
 scanf ("%d%d%d",&y2,&m2,&d2);
 year=y1;
 if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
  t=dayr(m1,d1);
  else t=dayfr(m1,d1);
 for (year=y1+1;year<=y2;year++)
  if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
   t=t+dayr(1,1)+1;
  else t=t+dayfr(1,1)+1;
  year=y2;
 if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
  t=t-dayr(m2,d2);
  else t=t-dayfr(m2,d2); 
 printf ("%d",t);
}