semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int nian(int a,int b);
	int qian(int a,int b,int c);
	int hou(int a,int b,int c);
	int a,b,c,d,e,f,g,k;
	scanf("%d%d%d\n",&a,&b,&c);
	scanf("%d%d%d",&d,&e,&f);
	g=d-a;
	k=nian(a,g);
	if(g!=0)
	{k=k+qian(a,b,c);
	k=k+hou(d,e,f);}
	else
	{k=k+hou(d,e,f);
	k=k-hou(a,b,c);
	}
	printf("%d\n",k);
}
	
int nian(int a,int b)
{   int i,j=0;
	for(i=1;i<=b-1;i++)
	{if(((a+i) % 4 == 0 && (a+i) % 100 != 0) || ((a+i) % 400 == 0))
		j=j+366;
	else j=j+365;
	}
	return(j);
}

int qian(int a,int b,int c)
{
	int pd1(int a,int b);
	int pd2(int a,int b);
	int pd3(int a);
	int pd4(int a);
	int e=0,i,j;
	if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
     {
     e=pd1(b,c);
     for(i=b+1;i<=12;i++)
     {e=e+pd3(i);}}
     else 
      {
     e=pd2(b,c);
     for(i=b+1;i<=12;i++)
     {e=e+pd4(i);}}
    return(e);
     }
     
int hou(int a,int b,int c)
{
	int pd3(int a);
	int pd4(int a);
	int e,i,j;
	e=c;
	if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
     {
     for(i=1;i<b;i++)
     {e=e+pd3(i);}}
     else 
      {
     for(i=1;i<b;i++)
     {e=e+pd4(i);}}
    return(e);
     }
     
     
int pd1(int a,int b)
{switch(a)
	{case 1:return(31-b);break;
	case 2:return(29-b);break;
	case 3:return(31-b);break;
	case 4:return(30-b);break;
	case 5:return(31-b);break;
	case 6:return(30-b);break;
	case 7:return(31-b);break;
	case 8:return(31-b);break;
	case 9:return(30-b);break;
	case 10:return(31-b);break;
	case 11:return(30-b);break;
	case 12:return(31-b);break;
	default:return(0);}
}


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

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

int pd4(int a)
{switch(a)
	{case 1:return(31);break;
	case 2:return(28);break;
	case 3:return(31);break;
	case 4:return(30);break;
	case 5:return(31);break;
	case 6:return(30);break;
	case 7:return(31);break;
	case 8:return(31);break;
	case 9:return(30);break;
	case 10:return(31);break;
	case 11:return(30);break;
	case 12:return(31);break;
	default:return(0);}
}
int B[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int A[12]={31,29,31,30,31,30,31,31,30,31,30,31};
int runnian(int year)
{
	if((year%4==0&&year%100!=0)||(year%400==0))
		return 1;
	else
		return 0;
}
int count1(int startmonth,int startday,int endmonth,int endday)
{
	int result=0,i;
	if(startmonth<=endmonth)
	{
		for(i=startmonth;i<endmonth;i++)
		{
			result=result+A[i-1];
		}
		result=result+endday-startday;
	}
	else
	{
		for(i=startmonth;i>endmonth;i--)
		{
			result=result-A[i-2];
		}
		result=result+endday-startday;
	}
	return result;
}
int count2(int startmonth,int startday,int endmonth,int endday)
{
    int result=0,i;
	if(startmonth<=endmonth)
	{
		for(i=startmonth;i<endmonth;i++)
		{
			result=result+B[i-1];
		}
		result=result+endday-startday;
	}
	else
	{
		for(i=startmonth;i>endmonth;i--)
		{
			result=result-B[i-2];
		}
		result=result+endday-startday;
	}
	return result;
}
int main()
{
	int startYear,startMonth,startDay;
	int endYear,endMonth,endDay;
	int i;
	int sum=0;
	int temp;
	scanf("%d%d%d",&startYear,&startMonth,&startDay);
	scanf("%d%d%d",&endYear,&endMonth,&endDay);
	if(startYear==endYear)
	{
		if(runnian(startYear))
		{
			sum=count1(startMonth,startDay,endMonth,endDay);
		}
		else
		{
			sum=count2(startMonth,startDay,endMonth,endDay);
		}
	}
	else
	{
		if(startYear>endYear)
		{
			temp=endYear;
			endYear=startYear;
			startYear=temp;
            temp=endMonth;
			endMonth=startMonth;
			startMonth=temp;
            temp=endDay;
			endDay=startDay;
			startDay=temp;
		}
	}
	if(startYear<endYear)
	{
		for(i=startYear;i<endYear;i++)
		{
			if(runnian(i))
			{
				sum=sum+366;
			}
			else
			{
				sum=sum+365;
			}
		}
        if(runnian(endYear))
		{
			sum=sum+count1(startMonth,startDay,endMonth,endDay);
		}
		else
		{
			sum=sum+count2(startMonth,startDay,endMonth,endDay);
		}
	}
	printf("%d",sum);
	return 0;
}
/*?? 
???????????????. 
??2010-1-1?2010-1-3 ???2?? 

year=1,2,...,3000. 

??? 
????(year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)? 
???2???29??
 
???? 
??? 
startYear startMonth startDay 
??? 
endYear endMonth endDay
 
???? 
???????????????? */
int main()
{
  int a,b,c;
  int j,k,l,sum=0;
  int y[3000],s1=0,s2=0,d1,d2;

  int i1,i2,i3,i4,i5,i;
  scanf("%d%d%d",&a,&b,&c);
  scanf("%d%d%d",&j,&k,&l);
     for(i1=a;i1<=j;i1++)
	 {  
	       if((i1%4==0&&i1%100!=0)||(i1%400==0))
             y[i1]=366;
		   else
             y[i1]=365;
	 }
     if(y[a]==365)
	 {
		 for(i=b;i>=1;i--)
		 {
			 if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			 {
                 s1=s1+31;
			 }
			  if(i==4||i==6||i==9||i==11)
			 {
                 s1=s1+30;
			 } 
			  if(i==2)
			  {
				  s1=s1+28;
			  }
		 }
	 }
if(y[a]==366)
	 {
		 for(i2=k;i2>=1;i2--)
		 {
			 if(i2==1||i2==3||i2==5||i2==7||i2==8||i2==10||i2==12)
			 {
                 s1=s1+31;
			 }
			  if(i2==4||i2==6||i2==9||i2==11)
			 {
                 s1=s1+30;
			 } 
			  if(i2==2)
			  {
				  s1=s1+29;
			  }
		 }
	 }
    
   
   
   if(y[j]==365)
	 {
		 for(i3=k;i3>=1;i3--)
		 {
			 if(i3==1||i3==3||i3==5||i3==7||i3==8||i3==10||i3==12)
			 {
                 s2=s2+31;
			 }
			  if(i3==4||i3==6||i3==9||i3==11)
			 {
                 s2=s2+30;
			 } 
			  if(i3==2)
			  {
				  s2=s2+28;
			  }
		 }
	 }
if(y[j]==366)
	 {
		 for(i4=k;i4>=1;i4--)
		 {
			 if(i4==1||i4==3||i4==5||i4==7||i4==8||i4==10||i4==12)
			 {
                 s2=s2+31;
			 }
			  if(i4==4||i4==6||i4==9||i4==11)
			 {
                 s2=s2+30;
			 } 
			  if(i4==2)
			  {
				  s2=s2+29;
			  }
		 }
	 }

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

}



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

int Counting(int month, int date, int leapYear)
{
	int count=0;
	int i; 
	if(leapYear==1)
	{
		for(i=1;i<month;i++)
		{
			count+=g2[i];
		}
	}
	else
	{
		for(i=1;i<month;i++)
		{
			count+=g1[i];
		}
	}
	count+=date;
	return count;
}
int main()
{
	int a,b,c,d,e,f,i,j,g,sumy1,sumy2,summ1,summ2,h;
	scanf("%d %d %d\n",&a,&b,&c);
	scanf("%d %d %d",&d,&e,&f);
	sumy1=0;
	for(i=1;i<=a-1;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)) g=1;
	    else g=0;
		sumy1=sumy1+g;
	}
	sumy1=sumy1+365*(a-1);
	sumy2=0;
	for(i=1;i<=d-1;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)) g=1;
	    else g=0;
		sumy2=sumy2+g;
	}
	sumy2=sumy2+365*(d-1);
	/*???*/

	if(b==1) summ1=0;
	if(b==2) summ1=31;
	if(b==3) summ1=31+28;
	if(b==4) summ1=31+28+31;
	if(b==5) summ1=31+28+31+30;
	if(b==6) summ1=31+28+31+30+31;
	if(b==7) summ1=31+28+31+30+31+30;
	if(b==8) summ1=31+28+31+30+31+30+31;
	if(b==9) summ1=31+28+31+30+31+30+31+31;
	if(b==10) summ1=31+28+31+30+31+30+31+31+30;
	if(b==11) summ1=31+28+31+30+31+30+31+31+30+31;
	if(b==12) summ1=31+28+31+30+31+30+31+31+30+31+30;
	if(((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) &&(b>=3)) g=1;
	else g=0;
    summ1=summ1+g;
	if(e==1) summ2=0;
	if(e==2) summ2=31;
	if(e==3) summ2=31+28;
	if(e==4) summ2=31+28+31;
	if(e==5) summ2=31+28+31+30;
	if(e==6) summ2=31+28+31+30+31;
	if(e==7) summ2=31+28+31+30+31+30;
	if(e==8) summ2=31+28+31+30+31+30+31;
	if(e==9) summ2=31+28+31+30+31+30+31+31;
	if(e==10) summ2=31+28+31+30+31+30+31+31+30;
	if(e==11) summ2=31+28+31+30+31+30+31+31+30+31;
	if(e==12) summ2=31+28+31+30+31+30+31+31+30+31+30;
	if(((d % 4 == 0 && d % 100 != 0) || (d % 400 == 0))&&(e>=3)) g=1;
	else g=0;
    summ2=summ2+g;

	/*???*/

	h=sumy2+summ2+f-sumy1-summ1-c;
	printf("%d",h);
	return 0;
}
int main(){
	int y1,y2,m1,m2,d1,d2,n1=0,n2=0,n3=0,i,j;
	int mouth1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int mouth2[13]={0,31,29,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))n1+=366;
		else n1+=365;
	}
	if((y2% 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
		for(j=0;j<m2;j++)
			n2+=mouth2[j];
	else
		for(j=0;j<m2;j++)
			n2+=mouth1[j];
	if((y1% 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
			for(j=0;j<m1;j++)
				n2-=mouth2[j];
		else
			for(j=0;j<m1;j++)
				n2-=mouth1[j];
	n3=d2-d1;
	int sum=n1+n2+n3;
	cout<<sum<<endl;
	return 0;
}
int dayofy( int year )
{
	if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 366 ;
	else return 365 ;
}
int dayofm( int day , int mon , int year )
{
	int i , temp , sum = 0 ;
	for ( i = 1 ; i < mon ; i++ )
	{
	if ( i == 2 )
	{
		if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
			temp = 29 ;
		else temp = 28 ;
	}
	else if ( i == 4 || i == 6 || i == 9 || i == 11 )
		temp = 30 ;
	else temp = 31 ;
	sum += temp ;
	}
	return sum+day ;
}
		
int main ()
{
	int syear , smon , sday , eyear , emon , eday , i , j , disyear=0 , disday=0 ;
	cin >> syear >> smon >> sday >> eyear >> emon >> eday ;
	for ( i = syear ; i < eyear ; i++ )
	{
		disyear += dayofy(i) ;
	}
	disday = dayofm( eday ,emon , eyear ) - dayofm( sday , smon ,syear ) ;
	cout << disyear+disday << endl ;
	return 0 ;
}
int main()
{
	int y1,m1,d1,y2,m2,d2,i,s=0;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>y1>>m1>>d1>>y2>>m2>>d2;

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

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

	for(i = 1; i < endmonth ; i++)
		num += month[i];
	num += endday;
	}
	cout << num << endl;
	return 0;
}
void main()
{
	int year(int y);
	int day(int m,int d);
	int y1,m1,d1,y2,m2,d2,i,x,k=0;
	scanf("%d%d%d",&y1,&m1,&d1);
	scanf("%d%d%d",&y2,&m2,&d2);
	for(i=y1;i<y2;i++)
		k=k+year(i);
	x=365*(y2-y1)+k;
	x=x+day(m2,d2)-day(m1,d1);
	if(year(y1)==1&&m1>2) x--;
	if(year(y2)==1&&m2>=3) x++;
	printf("%d",x);
}
int year(int y)
{	int z;
	if((y%4==0&&y%100!=0)||(y%400==0)) z=1;
	else z=0;
	return z;
}
int day(int m,int d)
{	int z;
	z=d;
	switch(m)
	{		case 2:z=z+31;break;
			case 3:z=z+31+28;break;
			case 4:z=z+31*2+28;break;
			case 5:z=z+30+31*2+28;break;
			case 6:z=z+31*3+30+28;break;
			case 7:z=z+30*2+31*3+28;break;
			case 8:z=z+31*4+30*2+28;break;
			case 9:z=z+31*5+30*2+28;break;
			case 10:z=z+30*3+31*5+28;break;
			case 11:z=z+31*6+30*3+28;break;
			case 12:z=z+30*4+31*6+28;break;
	}
	return z;
}
void main(){
	int s,t,i,y,m,d,Y,M,D,n;
	scanf("%d%d%d%d%d%d",&y,&m,&d,&Y,&M,&D);
	s=0;
	t=0;
	for(i=1;i<=y-1;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
		{
			s=s+366;
		}
		else s=s+365;
	}
	for(i=1;i<=m-1;i++)
	{
		switch(i)
		{
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:s=s+31;break;
		case 4:
		case 6:
		case 9:
		case 11:s=s+30;break;
		case 2:{
			if((y%4==0&&y%100!=0)||(y%400==0)) s=s+29;
			else s=s+28;
			   }
		}
	}
	s=s+d;
	for(i=1;i<=Y-1;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
		{
			t=t+366;
		}
		else t=t+365;
	}
	for(i=1;i<=M-1;i++)
	{
		switch(i)
		{
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:t=t+31;break;
		case 4:
		case 6:
		case 9:
		case 11:t=t+30;break;
		case 2:{
			if((Y%4==0&&Y%100!=0)||(Y%400==0)) t=t+29;
			else t=t+28;
			   }
		}
	}
	t=t+D;
	n=t-s;
	printf("%d",n);
}
int main()
{
	int day = 0, i;
	int year1, year2, m1, m2, d1, d2;
	cin >> year1 >> m1 >> d1;
	cin >> year2 >> m2 >> d2;
	int a[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	int b[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};
	if ( (year2 - year1) == 0 )
	{
		if ( m1 == m2 )
			day = d2 -d1;
		else
		{
		if ( (year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0) )
		{
			for ( i = m1+1; i <= m2-1; i++ )
				day = day + b[i];
		day = day + b[m1] - d1 + d2;
		}
		else
		{
			for ( i = m1+1; i <= m2-1; i++ )
				day = day + a[i];
		day = day + a[m1] - d1 + d2;
		}
		}
	}
	if ( (year2 - year1) == 1 )
	{
		day = 0;
		if ( (year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0) )
		{
			for ( i = m1 + 1; i <= 12; i++ )
				day = day + b[i];
		day = day + b[m1] - d1;
		}
		else
		{
			for ( i = m1 + 1; i <= 12; i++ )
				day = day + a[i];
		day = day + a[m1] - d1;
		}
		if ( (year2 % 4 == 0 && year2 % 100 != 0) || (year2 % 400 == 0) )
		{
			for ( i = 1; i <= m2 - 1; i++ )
				day = day + b[i];
			day = day + d2;
		}
		else
		{
				for ( i = 1; i <= m2 - 1; i++ )
				day = day + a[i];
			day = day + d2;
		}
	}
	if ( (year2 - year1) > 2 )
	{
		day = 0;
		for ( i = year1 + 1; i <= year2 - 1; i++ )
		{
			if  ( (i % 4 == 0 && i % 100 != 0) || (i % 400 == 0) )
				day = day + 366;
			else
				day = day + 365;
		}
		if ( (year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0) )
		{
			for ( i = m1 + 1; i <= 12; i++ )
				day = day + b[i];
		day = day + b[m1] - d1;
		}
		else
		{
			for ( i = m1 + 1; i <= 12; i++ )
				day = day + a[i];
		day = day + a[m1] - d1;
		}
		if ( (year2 % 4 == 0 && year2 % 100 != 0) || (year2 % 400 == 0) )
		{
			for ( i = 1; i <= m2 - 1; i++ )
				day = day + b[i];
			day = day + d2;
		}
		else
		{
				for ( i = 1; i <= m2 - 1; i++ )
				day = day + a[i];
			day = day + d2;
		}
	}
cout << day <<endl;
return 0;
	}
int yuandan(int year,int month,int day);
int main()
{
    int year1,year2,month1,month2,day1,day2,t;
    int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int yuandan1=0,yuandan2=0;
    int num=0;
    int i;
    cin>>year1>>month1>>day1;
    cin>>year2>>month2>>day2;
    if(year2<year1)
    {
     t=year1;year1=year2;year2=t;
     t=month1;month1=month2;month2=t;
     t=day1;day1=day2;day2=t;                              
    }
    yuandan1=yuandan(year1,month1,day1);
    yuandan2=yuandan(year2,month2,day2);
    
    for(i=year1;i<year2;i++)
    {
      num+=365;
      num+= ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0));                       
    }
    
    num=num+yuandan2-yuandan1;
    cout<<num;
    
    
    
return 0;    
}
int yuandan(int year,int month,int day)
{
  int yue[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
  yue[2]=29;
  else
  yue[2]=28;
  
  int i,sum=0;
  if(month==1)
  return day;
  else
  {
    for(i=1;i<=month-1;i++)
    sum+=yue[i];  
    sum+=day ; 
  }    
    return sum;
}
int main()
{
	int time1=0,time2=0,result=0;
   int year1,year2,month1,month2,day1,day2;
   cin>>year1>>month1>>day1>>year2>>month2>>day2;
   int dayofmonth[13]={31,28,31,30,31,30,31,31,30,31,30,31};
   int stayear=min(year1,year2);
   if(stayear%4==0&&stayear%100!=0||stayear%400==0)
	   dayofmonth[1]=29;
   for(int month=0;month<month1-1;month++)
	   time1+=dayofmonth[month];
   time1+=day1-1;
   dayofmonth[1]=28;
   for(int year=stayear;year<max(year1,year2);year++)
   {
      if(year%4==0&&year%100!=0||year%400==0)
	   time2+=366;
	  else time2+=365;
   }
	  int temp=max(year1,year2);
if(temp%4==0&&temp%100!=0||temp%400==0)
	   dayofmonth[1]=29;
for(int monthtemp=0;monthtemp<month2-1;monthtemp++)
	time2+=dayofmonth[monthtemp];
time2+=day2-1;
cout<<time2-time1<<endl;

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


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

printf("%d",TOTAL2-TOTAL1);
return 0;
}
int judge1(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	else
		return 0;
}
int judge2(int y1,int m1,int d1, int y2, int m2, int d2)
{
	if(y1 < y2)
		return -1;
	else if(y1 > y2)
		return 1;
	else
	{
		if(m1 < m2)
			return -1;
		else if(m1 > m2)
			return 1;
		else
		{
			if(d1 < d2)
				return -1;
			else if(d1 > d2)
				return 1;
			else
				return 0;
		}
	}
}
int main()
{
	int a[13] ={0,31,28,31,30,31,30,31,31,30,31,30,31} ;
	int b[13] ={0,31,29,31,30,31,30,31,31,30,31,30,31} ;
	int y1, m1, d1;
	int y2, m2, d2;
	cin >> y1 >> m1 >> d1;
	cin >> y2 >> m2 >> d2;
	int sum = 0;
	for(int i = y1 + 1; i <= y2 - 1; i++)
	{
		if(judge1(i) == 1)
			sum += 366;
		else
			sum += 365;
	}
	if(y1 != y2){
	for(int i = m1 + 1; i <= 12; i++)
		if(judge1(y1) == 1)
			sum += b[i];
		else
			sum += a[i];
	for(int i = 1; i <= m2 - 1; i++)
		if(judge1(y2) == 1)
			sum += b[i];
		else
			sum += a[i];}
	if(y1 ==y2 && m1 == m2)
	{
		sum += d2 - d1;
	}
	else{
	sum += d2;
	if(m1 != 2)
		sum += a[m1] - d1;
	else
	{
		if(judge1(y1) == 1)
			sum += 29 - d1;
		else
			sum += 28 - d1;
	}
	}
	cout << sum << endl;
	return 0;
}
void main()
{
	int a,b,c,d,e,f,i,j,k,sum=0;
	scanf("%d%d%d",&a,&b,&c);
	scanf("%d%d%d",&d,&e,&f);
	for(i=a;i<=d;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0)) 
			sum=sum+366;
		else
			sum=sum+365;
	}
	for(j=1;j<=b-1;j++)
	{
		if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			sum=sum-31;
		else if(j==4||j==6||j==9||j==11)
				sum=sum-30;
			else if((a%4==0&&a%100!=0)||(a%400==0))
					sum=sum-29;
				else
					sum=sum-28;
	}
	for(j=e+1;j<=12;j++)
	{
		if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			sum=sum-31;
		else if(j==4||j==6||j==9||j==11)
				sum=sum-30;
			else if((d%4==0&&d%100!=0)||(d%400==0))
					sum=sum-29;
				else
					sum=sum-28;
	}
	j=e;
	if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			sum=sum+f-31;
		else if(j==4||j==6||j==9||j==11)
				sum=sum+f-30;
			else if((j%4==0&&j%100!=0)||(j%400==0))
					sum=sum+f-29;
				else
					sum=sum+f-28;
	sum=sum-c;
	printf("%d",sum);
	
}
int main()
{
	int year1,month1,date1,year2,month2,date2;                             //1?????2????//
	int year_2;                                                            //faciliate caculation//
	int year,month,date;
	scanf("%d%d%d\n%d%d%d",&year1,&month1,&date1,&year2,&month2,&date2);
	year_2=year2;
	if(date1<=date2) date=date2-date1;
	else 		
	{
		month2=month2-1; 
		        if((month2<=7&&month2%2!=0)||(month2>7&&month2%2==0))     //????????????//
                date=date2-date1+31;
	            else if(month2!=2) 
			    date=date2-date1+30;
                     else if((year2%4==0&&year2%100!=0)||(year2%400==0))           //????//
						  date=date2-date1+29;
					      else date=date2-date1+28;
	}
	if(month2>=month1) month=month2-month1;
	else             
	{
		month=month2-month1+12;
		year_2=year2-1;
	}
	year=year_2-year1;

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

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

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

	return 0;

    
}