semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
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		pan(int);
int main()
{
	int		mou[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		year1, mou1, date1;
	int		year2, mou2, date2;
	int		day1 = 0, day2 = 0;
	int		i;
	cin >> year1 >> mou1 >> date1;
	cin >> year2 >> mou2 >> date2;

	for (i = 1; i <= mou1 - 1; i ++)
	{
		day1 += mou[pan(year1)][i];
	}
	day1 += date1;

	for (i = year1; i < year2; i ++)
	{
		day2 = day2 + 365 + pan(i);
	}
	for (i = 1; i <= mou2 - 1; i ++)
	{
		day2 += mou[pan(year2)][i];
	}
	day2 += date2;

	int	cha = labs(day1 - day2);
	cout << cha << endl;





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

	
}
int main()
{
	int y1,m1,d1,y2,m2,d2;
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	int i,sum=0;
	for (i=y1;i<y2;i++)
	{
		sum+=365+runnian(i);
	}
	sum=sum+rizi(y2,m2,d2)-rizi(y1,m1,d1);
	cout<<sum;
	return 0;
}
int judge(int x)
{
	if((x%4==0&&x%100!=0)||x%400==0)
		return 1;
	else
		return 0;
}
int main()
{
	int y1,y2,d1,d2,m1,m2,sum=0,i;
	int pin[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int run[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	if(y1==y2)
	{
		if(m1==m2)
			sum=d2-d1;
		else
		{
			if(judge(y1))
			{
				for(i=m1+1;i<m2;i++)
				{
					sum=sum+run[i];
				   sum=sum+run[m1]-d1+d2;
				}
			}
			else
			{
				for(i=m1+1;i<m2;i++)
				{
					sum=sum+pin[i];
				    sum=sum+pin[m1]-d1+d2;
				}
			}
		}
	}
	else
	{
		if(judge(y1))
		{
			for(i=12;i>m1;i--)
			{
				sum=sum+run[i];
			}
			sum=sum+run[m1]-d1;
		}
		else
		{
				for(i=12;i>m1;i--)
				{
					sum=sum+pin[i];
				}
				sum=sum+pin[m1]-d1;
		}
		for(i=y1+1;i<y2;i++)
		{
			if(judge(i))
				sum=sum+366;
			else
				sum=sum+365;
		}
		if(judge(y2))
		{
			for(i=1;i<m2;i++)
			{
				sum=sum+run[i];
			}
			sum=sum+d2;
		}
		else
		{
			for(i=1;i<m2;i++)
			{
				sum=sum+pin[i];
			}
			sum=sum+d2;
		}
	}
	cout<<sum<<endl;
	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;
}
/*
 * ????1000012845_0.cpp
 * ?????2011-1-9
 * ???????
 * ????????????????
 */

int main()
{
   int sy,sm,sd,ey,em,ed,sum=0,i;
   int m[12]={31,28,31,30,31,30,31,31,30,31,30,31},n[12]={31,29,31,30,31,30,31,31,30,31,30,31};
   cin>>sy>>sm>>sd;
   cin>>ey>>em>>ed;
   for(i=sy+1;i<ey;i++)
   {
	   if((i%4==0&&i%100!=0)||(i%400==0))
		   sum=sum+366;
	   else
		   sum=sum+365;
   }
   if(ey>sy)
   {
   if((ey%4==0&&ey%100!=0)||(ey%400==0))
   {
	   for(i=0;i<em-1;i++)
		   sum=sum+n[i];
   }
   else
   {
	   for(i=0;i<em-1;i++)
		   sum=sum+m[i];
   }
   if((sy%4==0&&sy%100!=0)||(sy%400==0))
   {
	   for(i=11;i>sm-1;i--)
		   sum=sum+n[i];
	   sum=sum+n[sm-1]-sd;
   }
   else
   {
	   for(i=11;i>sm-1;i--)
		   sum=sum+m[i];
	   sum=sum+m[sm-1]-sd;
   }
   }
   else if((ey%4==0&&ey%100!=0)||(ey%400==0))
   {
	   if(sm<em)
	   {
		   for(i=sm;i<em-1;i++)
			   sum=sum+n[i];
		   sum=sum+n[sm-1]-sd;
	   }
	   else
		   sum=sum-sd;
   }
   else
   {
	   if(sm<em)
	   {
		   for(i=sm;i<em-1;i++)
			   sum=sum+m[i];
		   sum=sum+m[sm-1]-sd;
	   }
	   else
		   sum=sum-sd;
   }
   cout<<sum+ed<<endl;
   return 0;
}
int main()
{
	int y1, m1, d1, y2, m2,d2;
	cin >> y1 >> m1 >>d1 >> y2 >> m2 >> d2;
	int yg1 = 0, yg2 = 0;
	if ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
		yg1 = 1;
	if ((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
		yg2 = 1;
	int date1 = 0, date2 = 0;
	int i, j;
	for (i = 1; i < m1; i++)
	{
		if ( i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 1 || i == 10 || i == 12)
			date1 = date1 + 31;
		if ( i == 4 || i == 6 || i == 9 || i == 11 )
			date1 = date1 + 30;
		if (i == 2)
		{
			if (yg1)
				date1 = date1 + 29;
			else
				date1 = date1 + 28;
		}
	}
	date1 = date1 + d1;
	for (i = 1; i < m2; i++)
	{
		if ( i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 1 || i == 10 || i == 12)
			date2 = date2 + 31;
		if ( i == 4 || i == 6 || i == 9 || i == 11 )
			date2 = date2 + 30;
		if (i == 2)
		{
			if (yg2)
				date2 = date2 + 29;
			else
				date2 = date2 + 28;
		}
	}
	date2 = date2 + d2;
	int date = 0;
	for (i = y1; i < y2; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			date = date + 366;
		else 
			date = date + 365;
	}
	date = date + date2 - date1;
	cout << date;
	return 0;
}
main() 
{  
 long y,i,a[2],b[2],c[2],z[2]; 
 int x[]={0,0,31,59,90,120,151,181,212,243,273,304,334};  
 scanf("%ld%ld%ld",&a[0],&b[0],&c[0]);
 scanf("%ld%ld%ld",&a[1],&b[1],&c[1]);
 for(i=0;i<2;i++)  
 { y=a[i]/4-a[i]/100+a[i]/400+a[i]*365;  
 if((a[i]%(a[i]%100?4:400)==0)&&b[i]<3)y--;  
 z[i]=x[b[i]]+y+c[i]; 
 }  
 printf("%ld\n",z[1]-z[0]);  
}
void main()
{
	int i,s,a,b,c,d,e,f,x,y,z;
	scanf("%d %d %d",&a,&b,&c);
	scanf("%d %d %d",&d,&e,&f);
	s=(d-a)*365;
	for(x=0,i=a;i<=d-1;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0) x=x+1;
	}
	s+=x;s=s-c+f;
	y=30*(b-1); for(x=1;x<b;x++)
	{
		if(x==1||x==3||x==5||x==7||x==8||x==10) y=y+1;
		else if(x==2) {
			if(a%4==0&&a%100!=0||a%400==0) y=y-1;
			else y=y-2;
		}
	}
		z=30*(e-1); for(x=1;x<e;x++)
	{
		if(x==1||x==3||x==5||x==7||x==8||x==10) z=z+1;
		else if(x==2) {
			if(d%4==0&&d%100!=0||d%400==0) z=z-1;
			else z=z-2;
		}
	}
		s=s-y+z;
		printf("%d",s);   
}
int main () {
	int i , j ;
	int Month[13] = { 29 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ;
	int year1 , month1 , day1 , year2 , month2 , day2 , run1 = 0 , run2 = 0 ,day = 0;
	cin >> year1 >> month1 >> day1 >> year2 >> month2 >> day2 ;
	if ((year1 % 4 == 0 && year1 % 100 != 0) ||(year1 % 400 == 0) )
		run1 = 1 ;
	if ((year2 % 4 == 0 && year2 % 100 != 0) ||(year2 % 400 == 0) )
		run2 = 1;
	if ( year1 == year2 ) {
		if ( month1 == month2 ) {
			day = day2 - day1 ;
		}
		else {
					day += ( Month[month1]-day1 ) ;
				day += day2 ;
				for ( i = (month1+1) ; i < month2 ; i ++ )
					day += Month[i];
				if ( (month1 <= 2 ) && (month2 > 2) && (run1 == 1 ))
					day ++ ;
		}
	}
	else {
		day += (Month[month1] - day1) ;
		for ( i = (month1+1) ; i <= 12 ; i ++ )
			day += Month[i] ;
		if ( ( run1 == 1 ) && ( month1 <=2 ) )
			day ++ ;
		day += day2 ;
		for ( i = 1 ; i < month2 ; i ++ )
			day += Month[i] ;
		if ( ( month2 > 2 ) && ( run2 == 1 ) )
			day++ ;
		for ( i = (year1+1) ; i < year2 ; i ++ ) {
			day += 365 ;
			if ((i % 4 == 0 && i % 100 != 0) ||(i % 400 == 0) )
				day ++ ;
		}
	}
	cout << day ;
}
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 Is (int year)
{
	return((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
}
int main()
{
	int sy, sm, sd, ey,em,ed;
	int y,m;
	int d=0;
	int a[12]={31,0,31,30,31,30,31,31,30,31,30,31};
	cin >> sy>>sm >> sd >> ey>> em>>ed;
	if (sy==ey)
		if (sm == em)
			d=ed-sd;
		else
		{
			if(Is(sy))
				a[1]=29;
			else
				a[1]=28;
			for (m=sm+1;m<=em-1;m++)
				d=d+a[m-1];
			d=d+a[sm-1]-sd+ed;
		}
	else
	{
		if(Is(sy))
			a[1]=29;
		else
			a[1]=28;
		d=d+a[sm-1]-sd;
		for (m=sm+1;m<=12;m++)
			d=d+a[m-1];
		if(Is(ey))
			a[1]=29;
		else
			a[1]=28;
		d=d+ed;
		for (m=1;m<=em-1;m++)
			d=d+a[m-1];
		for (y=sy+1;y<=ey-1;y++)
			if(Is(y))
				d=d+366;
			else
				d=d+365;
	}

	cout << d <<endl;


	return 0;
}
int main()
{
	int y[2],m[2],d[2],day=0,i;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>y[0]>>m[0]>>d[0]>>y[1]>>m[1]>>d[1];
	if((y[1]-y[0])>0)
	{
		if((y[0]%4==0&&y[0]%100!=0)||(y[0]%400)==0)
			a[2]=29;
		else
			a[2]=28;	
		day=day+(a[m[0]]-d[0]);
		for(i=m[0]+1;i<=12;i++)
			day+=a[i];
		if((y[1]%4==0&&y[1]%100!=0)||(y[1]%400)==0)
			a[2]=29;
		else
			a[2]=28;
		for(i=1;i<=m[1]-1;i++)
			day+=a[i];
		day+=d[1];
		while(y[1]-y[0]>1)
		{
			y[0]++;
			if((y[0]%4==0&&y[0]%100!=0)||(y[0]%400)==0)
				day+=366;
			else
				day+=365;
		}
	}
	else
	{
		if((m[1]-m[0])>0)
		{
			if((y[0]%4==0&&y[0]%100!=0)||(y[0]%400)==0)
				a[2]=29;
			else
				a[2]=28;	
			day=day+(a[m[0]]-d[0]);
			day+=d[1];
			for(i=m[0]+1;i<=m[1]-1;i++)
				day+=a[i];
		}
		else
			day=d[1]-d[0];
	}
	cout<<day;
	return 0;
}
int leap(int);
int main()
{
	int total[13]={0,31,59,90,120,151,181,212,243,273,304,334,365};
	int y1,y2,m1,m2,d1,d2;
	int sum=0,j;
	scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
	
	if (y1==y2){
	   	  if (leap(y1)==0)  sum+=total[m2-1]-total[m1-1]+d2-d1;
	   	  if (leap(y1)==1&&m2>2)  sum+=total[m2-1]-total[m1-1]+d2-d1+1; 
	}
	
	if (y2>y1){
       for(j=y1+1;j<y2;j++){
          if (leap(j)==1) sum+=366;
          else if (leap(j)==0) sum+=365;
       }
	   if (leap(y1)==0)  sum+=365-total[m1-1]-d1;
	   else if (leap(y1)==1&&m1<=2)  sum+=365-total[m1-1]-d1+1;
       
       if (leap(y2)==0)  sum+=total[m2-1]+d2;
       else if (leap(y2)==1&&m2>2)   sum+=total[m2-1]+d2+1;
	}
       
	printf("%d",sum);
	return 0;
}

int leap(int y){
	int j;
	if (y%400==0 || y%100!=0 && y%4 == 0) j=1;
	else j=0;
	return j;
}
int main()
{
	int a[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 year1,month1,date1,year2,month2,date2,day=0,year;
	cin>>year1>>month1>>date1>>year2>>month2>>date2;
	if(year1==year2)
	{
		if(month1==month2)
			day+=(date2-date1);
		else if(month1<month2)
		{
			if((year1%4==0&&year1%100!=0)||(year1%400==0))     year=1;
			else  year=0;
			day+=(a[year][month1-1]-date1);
			for(int i=month1+1;i<month2;i++)
				day+=a[year][i-1];
			day+=date2;
		}
	}
	else if(year1<year2)
	{
		if((year1%4==0&&year1%100!=0)||(year1%400==0))     year=1;
		else  year=0;
		day+=(a[year][month1-1]-date1);
		for(int i=month1+1;i<=12;i++)
			day+=a[year][i-1];
		for(int i=year1+1;i<year2;i++)
		{
			if((i%4==0&&i%100!=0)||(i%400==0))    day+=366;
			else  day+=365;
		}
		if((year2%4==0&&year2%100!=0)||(year2%400==0))     year=1;
		else  year=0;
		for(int i=1;i<month2;i++)
			day+=a[year][i-1];
		day+=date2;
	}
	cout<<day<<endl;
	return 0;
}
int main()
{
	int y[2], m[2], d[2], sum = 0, dec = 0, plu = 0;
	int mon[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
		Lmon[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> y[0] >> m[0] >> d[0];
	cin >> y[1] >> m[1] >> d[1];
	for (int i = y[0]; i < y[1]; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
		{
			sum += 366;
		}
		else
		{
			sum += 365;
		}
	}
	for (int j = 1; j < m[0]; j++)
	{
		if ((y[0] % 4 == 0 && y[0] % 100 != 0) || y[0] % 400 == 0)
		{
			dec += Lmon[j];
		}
		else
		{
			dec += mon[j];
		}
	}
	dec += d[0];
	sum -= dec;
	for (int k = 0; k < m[1]; k++)
	{
		if ((y[1] % 4 == 0 && y[1] % 100 != 0) || y[1] % 400 == 0)
		{
			plu += Lmon[k];
		}
		else
		{
			plu += mon[k];
		}
	}
	plu += d[1];
	sum += plu;
	cout << sum << endl;

	return 0;
}
int main()
{
	int di(int x,int y,int z);
	int a,b,c,d,e,f,day1,day2,sum=0,i;
	scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
	for(i=a;i<d;i++){
		if((i%4==0&&i%100!=0)||(i%400==0)){
			sum+=366;
		}
		else
			sum+=365;
	}
	day1=di(a,b,c);
	day2=di(d,e,f);
	sum=sum+day2-day1;
	printf("%d",sum);
	return 0;
}
int di(int x,int y,int z){
	int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int wei,j;
	if((x%4==0&&x%100!=0)||(x%400==0)){
		day[2]++;
	}
	wei=z;
	for(j=1;j<y;j++){
		wei+=day[j];
	}
	return wei;
}
int main()
{
  int sY,sM,sD,eY,eM,eD,sN,eN,N,num(int Y,int M,int D);
  scanf("%d%d%d\n%d%d%d",&sY,&sM,&sD,&eY,&eM,&eD);
  sN=num(sY,sM,sD);
  eN=num(eY,eM,eD);
  N=eN-sN;
  printf("%d",N);
  return 0;
}

int num(int Y,int M,int D)
{
  int N,a,M1,Y1;
  M1=M-1;
  Y1=Y-1;
  if(M1==1||M1==5||M1==6)
    a=1;
  else if(M1==2)
    a=-1;
  else if(M1==3||M1==4||M1==0)
    a=0;
  else if(M1==7)
    a=2;
  else if(M1==8||M1==9)
    a=3;
  else if(M1==10||M1==11)
    a=4;
  N=365*(Y-1)+(Y-1)/4-(Y-1)/100+(Y-1)/400+30*(M-1)+a+D;
  if(((Y%4==0&&Y%100!=0)||(Y%400==0))&&M>2)
    N=N+1;
  return(N);
}
int main()
{
	int year[2],month[2],day[2],a[][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},i,j,flag[2];
	int count[2]={0,0},b[2]={365,366},c[2]={0,0}/*????????????????*/;
	for(i=0;i<2;i++)
	{
		cin>>year[i]>>month[i]>>day[i];
	}
	if(year[0]>year[1])
	{
		j=year[1];
		year[1]=year[0];
		year[0]=j;
		j=month[1];
		month[1]=month[0];
		month[0]=j;
		j=day[1];
		day[1]=day[0];
		day[0]=j;
	}
	flag[0]=year[0]%4==0&&year[0]%100!=0||year[0]%400==0;
	flag[1]=year[1]%4==0&&year[1]%100!=0||year[1]%400==0;
	count[0]+=day[0]-1;
	count[1]+=day[1]-1;
	for(i=0;i<2;i++)
	{
		while(c[i]+1<month[i])
		{
				count[i]+=a[flag[i]][c[i]];
				c[i]++;
		}
	}
	while(year[0]<year[1])
	{
		count[1]+=b[year[0]%4==0&&year[0]%100!=0||year[0]%400==0];
		year[0]++;
	}
	cout<<count[1]-count[0]<<endl;
	char mm;
	cin>>mm;
	return 0;
}
int r[13],p[13];
int main()
{
	int a,b,c,d,e,f,g=0,i;
	r[1]=31;r[2]=29;r[3]=31;r[4]=30;r[5]=31;r[6]=30;r[7]=31;r[8]=31;r[9]=30;r[10]=31;r[11]=30;r[12]=31;
	p[1]=31;p[2]=28;p[3]=31;p[4]=30;p[5]=31;p[6]=30;p[7]=31;p[8]=31;p[9]=30;p[10]=31;p[11]=30;p[12]=31;
	scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
	if(a==d)
	{
		if((a%4==0&&a%100!=0)||(a%400==0))
		{
			if(b==e)
			{
				g=f-c;
			}
			else if(b!=e)
			{
				if(e=2)
					g=31-c+f;
				else if(e>2)
				{
					for(i=b;i<e;i++)
						g=g+r[i];
					g=g-c+f;
				}
			}
		}
		else
		{
			if(b==e)
				g=f-c;
			else if(b!=e)
			{
				if(e=2)
					g=31-c+f;
				else
				{
					for(i=b;i<e;i++)
						g=g+p[i];
					g=g-c+f;
				}
			}
		}
	}
	else if(a!=d)
	{
		for(i=a+1;i<d;i++)
		{
			if((i%4==0&&i%100!=0)||(i%400==0))
				g=g+366;
			else
				g=g+365;
		}
		if((a%4==0&&a%100!=0)||(a%400==0))
		{
			for(i=b+1;i<=12;i++)
				g=g+r[i];
			g=g+r[b]-c;
		}
		else
		{
			for(i=b+1;i<=12;i++)
				g=g+p[i];
			g=g+p[b]-c;
		}
		if((d%4==0&&d%100!=0)||(d%400==0))
		{
			for(i=1;i<e;i++)
				g=g+r[i];
			g=g+f;
		}
		else
		{
			for(i=1;i<e;i++)
				g=g+p[i];
			g=g+f;
		}
	}
	printf("%d",g);
	return 0;
}
int main()
{
        int year1,month1,day1,year2,month2,day2;
        int passday1,passday2;
        scanf("%d%d%d",&year1,&month1,&day1);
        scanf("%d%d%d",&year2,&month2,&day2);//??????????

        int Feb1,Feb2;//???????????????
        int passday=0;
        int i;

        if((year1%4==0&&year1%100!=0)||year1%400==0) Feb1=29;
        else Feb1=28;
        if((year2%4==0&&year2%100!=0)||year2%400==0) Feb2=29;
        else Feb2=28;//?????????????????29????28?

        /*???????????????????????????????????*/
        switch(month1)
        {
    case(1):
                passday1=337+Feb1-day1;
                break;
        case(2):
                passday1=306+Feb1-day1;
                break;
        case(3):
                passday1=306-day1;
                break;
        case(4):
                passday1=275-day1;
                break;
        case(5):
                passday1=245-day1;
                break;
        case(6):
                passday1=214-day1;
                break;
        case(7):
                passday1=184-day1;
                break;
        case(8):
                passday1=153-day1;
                break;
        case(9):
                passday1=122-day1;
                break;
        case(10):
                passday1=92-day1;
                break;
        case(11):
                passday1=61-day1;
                break;
        case(12):
                passday1=31-day1;
                break;
        }//???????????????????????????????????????+???????+?31-????????????

        for(i=year1+1;i<year2;i++)
        {
				//printf("add: %d %d %d",year1,year2,i);
                if ((i%4==0&&i%100!=0)||i%400==0) passday+=366;
                else passday+=365;
        }//????????????????

        switch(month2)
        {
        case(1):
                passday2=day2;
                break;
        case(2):
                passday2=31+day2;
                break;
        case(3):
                passday2=31+Feb2+day2;
                break;
        case(4):
                passday2=62+Feb2+day2;
                break;
        case(5):
                passday2=92+Feb2+day2;
                break;
        case(6):
                passday2=123+Feb2+day2;
                break;
        case(7):
                passday2=153+Feb2+day2;
                break;
        case(8):
                passday2=184+Feb2+day2;
                break;
        case(9):
                passday2=215+Feb2+day2;
                break;
        case(10):
                passday2=245+Feb2+day2;
                break;
        case(11):
                passday2=276+Feb2+day2;
                break;
        case(12):
                passday2=306+Feb2+day2;
                break;
        }//???????????????
        passday=passday+passday1+passday2;
		if(year1 == year2){
			if((year1%4==0&&year1%100!=0)||year1%400==0)
				passday -= 366;
			else
				passday -= 365;
		}
        printf("%d",passday);//?????
        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 y1,y2,m1,m2,d1,d2,s,i;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d %d %d",&y1,&m1,&d1);
	scanf("%d %d %d",&y2,&m2,&d2);
	if((y1==y2)&&(m1==m2))
		printf ("%d",d2-d1);
	else
	{
	s=0;
	s=s+(y2-y1-1)*365;
	for(i=m1+1;i<=12;i++)
		s=s+a[i];
	for (i=1;i<m2;i++)
		s=s+a[i];
	s=s+d2;
	s=s+a[m1]-d1;
	for(i=y1+1;i<y2;i++)
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
			s=s+1;
	if(((y1%4==0)&&(y1%100!=0))||(y1%400==0))
		if ((m1<=2)&&(m2>2)||(y2>y1))
			s=s+1;
	if(((y2%4==0)&&(y2%100!=0))||(y2%400==0))
		if((m2>2)&&((y1<y2)||(m1<m2)))
			s=s+1;
	printf("%d",s);
	}
	return 0;
}