semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int months1[12]={31,28,31,30,31,30,31,31,30,31,30,31},
	months2[12]={31,29,31,30,31,30,31,31,30,31,30,31};		//months1?????months2????
int check (int year);

int main()
{
	int year1,year2,month1,month2,day1,day2;
	int i,x=0,sum=0;
	cin>>year1>>month1>>day1>>year2>>month2>>day2;			//??????
	for (i=year1+1;i<year2;i++)
	{
		x=check(i);
		if (x==0)											//?????
			sum=sum+365;
		else if (x==1)										//?????
			sum=sum+366;
	}
	if (year1!=year2)
	{
		if (check(year1))										//year1???
		{
			for (i=month1+1;i<=12;i++)
				sum=sum+months2[i-1];
			sum=sum+months2[month1-1]-day1;
		}
		else													//year1???
		{
			for (i=month1+1;i<=12;i++)
				sum=sum+months1[i-1];
			sum=sum+months1[month1-1]-day1;
		}
		if (check(year2))										//year2???
		{
			for (i=1;i<month2;i++)
				sum=sum+months2[i-1];
			sum=sum+day2;
		}
		else													//year2???
		{
			for (i=1;i<month2;i++)
				sum=sum+months1[i-1];
			sum=sum+day2;
		}
	}
	else
	{
		if (check(year1))										//year1???
		{
			for (i=month1+1;i<month2;i++)
				sum=sum+months2[i-1];
			if (month1!=month2)
				sum=sum+months2[month1-1]-day1+day2;
			else
				sum=day2-day1;
		}
		else													//year1???
		{
			for (i=month1+1;i<month2;i++)
				sum=sum+months1[i-1];
			if (month1!=month2)
				sum=sum+months1[month1-1]-day1+day2;
			else
				sum=day2-day1;
		}
	}
	cout<<sum<<endl;
	return 0;
}

int check (int year)										//?????????????
{
	if (((year%4==0)&&(year%100!=0))||(year%400==0))
		return 1;
	else
		return 0;
}
int main()
{   
	int year[2]={365,366};
	int ym[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 sta=0,end=0;
	int stay,stam,stad,endy,endm,endd;
	int y,m;
	cin>>stay>>stam>>stad;
	cin>>endy>>endm>>endd;

	y=0;
	m=1;
	while(y<stay)
	{  
		sta=sta+year[(y%4==0&&y%100!=0)||(y%400==0)];
        y++;
	}
	while(m<stam)
	{
		sta=sta+ym[(y%4==0&&y%100!=0)||(y%400==0)][m];
		m++;
	}
	sta=sta+stad;
   
	y=0;
	m=1;
	while(y<endy)
	{  
		end=end+year[(y%4==0&&y%100!=0)||(y%400==0)];
        y++;
	}
	while(m<endm)
	{
		end=end+ym[(y%4==0&&y%100!=0)||(y%400==0)][m];
		m++;
	}
	end=end+endd;
    
	cout<<end-sta<<endl;
	return 0;
}
main()
{
  int y1,m1,d1,y2,m2,d2;
  int D1=0,D2=0,D=0,y,m,d;
  scanf("%d%d%d\n%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
  
  y=y1+1;
  while(y>=y1+1&&y<=y2-1)
  {
    if((y%4==0&&y%100!=0)||y%400==0)
    D=D+366;
    else D=D+365;
    y++;
  }
 
 m=m1-1; 
 switch(m)
 {
  case 11:D1=D1+30;
  case 10:D1=D1+31;
  case 9:D1=D1+30;
  case 8:D1=D1+31;
  case 7:D1=D1+31;
  case 6:D1=D1+30;
  case 5:D1=D1+31;
  case 4:D1=D1+30;
  case 3:D1=D1+31;
  case 2:
        {
          if((y1%4==0&&y1%100!=0)||y1%400==0)
          D1=D1+29;
          else D1=D1+28;
        }
  case 1:D1=D1+31;      
  case 0:break;
 }
 D1=D1+d1; 
  
 m=m2-1; 
 switch(m)
 {
  case 11:D2=D2+30;
  case 10:D2=D2+31;
  case 9:D2=D2+30;
  case 8:D2=D2+31;
  case 7:D2=D2+31;
  case 6:D2=D2+30;
  case 5:D2=D2+31;
  case 4:D2=D2+30;
  case 3:D2=D2+31;
  case 2:
        {
          if((y2%4==0&&y2%100!=0)||y2%400==0)
          D2=D2+29;
          else D2=D2+28;
        }
  case 1:D2=D2+31;      
  case 0:break;
  }
  D2=D2+d2;
  
  if(y1==y2)D=D2-D1;
  else
  {
    if((y1%4==0&&y1%100!=0)||y1%400==0)
    D=D+D2+366-D1;
    else D=D+D2+365-D1;
  }
  printf("%d\n",D);
}
int main()
{
	int y1,y2,m1,m2,d1,d2,i,j,k=0,n,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};
	scanf("%d %d %d",&y1,&m1,&d1);
	scanf("%d %d %d",&y2,&m2,&d2);
	if(y2==y1)
	{
		if(y1%400==0||y1%4==0&&y1%100!=0)
		{
			if(m1==m2)
			    printf("%d",d2-d1);
			else
			{
				if(m1<=2)
				{
					for(i=m1;i<m2;i++)
					{
						k+=a[i-1];
					}
					printf("%d\n",k+d2+1-d1);
				}
				else
				{
					for(i=m1;i<m2;i++)
					{
						k+=a[i-1];
					}
					printf("%d\n",k+d2+1-d1);
				}
			}    
		}
		else
		{
			if(m1==m2)
			    printf("%d\n",d2-d1);
			else
			{
				for(i=m1;i<m2;i++)
				{
					k+=b[i-1];
				}
				printf("%d\n",k+d2+1-d1);
			}
		}
	}
	else
	{
		if((y2-y1)==1)
		{
			if(y1%400==0||y1%4==0&&y1%100!=0)
			{
				if(m1<=2)
				{
					for(j=m1;j<=12;j++)
					{
						k+=a[j-1];
					}
					for(j=1;j<m2;j++)
					{
						k+=b[j-1];
					}
					printf("%d\n",k+d2+1-d1);
				}
			}
			else if(y2%400==0||y2%4==0&&y2%100!=0)
			{
				if(m2<2)
				{
					for(i=m1;i<=12;i++)
					{
						k+=b[i-1];
					}
					printf("%d\n",k+d2+1-d1);
				}
				else
				{
					for(i=m1;i<=12;i++)
					{
						k+=b[i-1];
					}
					for(i=1;i<m2;i++)
					{
						k+=a[i-1];
					}
					printf("%d\n",k+d2+1-d1);
				}
			}
		}
		else
		{
			for(i=y1+1;i<y2;i++)
			{
				if(i%400==0||i%4==0&&i%100!=0)
				    k+=366;
				else
				    k+=365;
			}
			if(y1%400==0||y1%4==0&&y1%100!=0)
			{
				if(y2%400==0||y2%4==0&&y2%100!=0)
				{
					for(j=m1;j<=12;j++)
					{
						k+=a[j-1];
					}
					for(j=1;j<m2;j++)
					{
						k+=a[j-1];
					}
					printf("%d\n",k+d2-d1);
				}
				else
				{
					for(j=m1;j<=12;j++)
					{
						k+=b[j-1];
					}
					for(j=1;j<m2;j++)
					{
						k+=b[j-1];
					}
					printf("%d\n",k+d2-d1);			
				}
			}
			else
			{
				if(y2%400==0||y2%4==0&&y2%100!=0)
				{
					for(j=m1;j<=12;j++)
					{
						k+=b[j-1];
					}
					for(j=1;j<m2;j++)
					{
						k+=a[j-1];
					}
					printf("%d\n",k+d2-d1);
				}
				else
				{
					for(j=m1;j<=12;j++)
					{
						k+=b[j-1];
					}
					for(j=1;j<m2;j++)
					{
						k+=a[j-1];
					}
					printf("%d\n",k+d2-d1);
				}
			}
		}
	}
	return 0;
}
int main()
{
    int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int i,j,k,sum,startyear,startmonth,startday,endyear,endmonth,endday;
    scanf("%d %d %d",&startyear,&startmonth,&startday);
    scanf("%d %d %d",&endyear,&endmonth,&endday);
    sum=0;
    if ( (startyear%4==0&&startyear%100!=0)||(startyear%400==0)){
         month[1]=29;
         }
    for (i=startyear+1;i<endyear;i++){
        if ( (i%4==0&&i%100!=0)||(i%400==0)){
             sum=sum+366;
             }
        else sum=sum+365;
        }
    if (startyear==endyear){
         if ( startmonth==endmonth){
              sum=endday-startday;
              }
         else {
              for (i=startday+1;i<=month[startmonth-1];i++){
                  sum=sum+1;
                  }
              for (i=startmonth+1;i<endmonth;i++){
                  sum=sum+month[i-1];
                  }
              for (i=1;i<=endday;i++){
                  sum=sum+1;
                  }
              }
         }
    else {
         for (i=startday+1;i<=month[startmonth-1];i++){
                  sum=sum+1;
                  }
         for (i=startmonth+1;i<=12;i++){
                  sum=sum+month[i-1];
                  }
         if ((endyear%4==0&&endyear%100!=0)||(endyear%400==0)){
             month[1]=29;
             }
         else month[i]=28;
         for (i=1;i<endmonth;i++){
             sum=sum+month[i-1];
             }
         for (i=1;i<=endday;i++){
             sum=sum+1;
             }
         }
    printf("%d",sum);
    return 0;       
}
void main( )
{

	int month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

    int start[3];

	int end[3];

	int i;

	int sum = 0;
	
	for(i = 0; i < 3; i++)
	{
        scanf("%d",&start[i]);
	}

	
	for(i = 0; i < 3; i++)
	{
        scanf("%d",&end[i]);
	}

	
	

	int j = start[0];

	for(;j <= end[0]; j++)
	{ 
	  sum = sum + 365;

      if((j%4 == 0 && j%100 != 0)||(j%400) == 0)  
	  {
             sum = sum + 1;
	  }
      
	}
	
		for(i = 1; i < start[1]; i++)
		{

         sum = sum - month[i];
		}

		sum = sum - start[2]; 

    if((start[0]%4 == 0 && start[0]%100 != 0)||(start[0]%400) == 0)  
	{
        if(i >= 2)
		{
          sum = sum - 1;
		}

		
            
	 }
		for(i = end[1]; i < 13; i++)
		{

         sum = sum - month[i];
		}

		sum = sum + end[2]; 

    if((end[0]%4 == 0 && end[0]%100 != 0)||(end[0]%400) == 0)  
	{
        if(end[1] <= 2)
		{
          sum = sum - 1;
		}

		
            
	 }

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


}
int main()
{
	int year1,year2,month1,month2,day1,day2,a,a1=0,a2;
	int date(int year,int a);
	scanf("%d%d%d",&year1,&month1,&day1);
	scanf("%d%d%d",&year2,&month2,&day2);
	for(;year1<year2||(year1==year2&&month1<month2);)
	{
		a1+=date(year1,month1);
		month1++;
		if(month1==13)
		{
			month1=1;
			year1++;
		}
	}
	a2=day2-day1;
	a=a1+a2;
	printf("%d\n",a);
	return 0;
}


int date(int year,int a)
{
	int b;
	if(a==1||a==3||a==5||a==7||a==8||a==10||a==12)
		b=31;
	else if(((year%4==0&&year%100!=0)||(year%400==0))&&a==2)
		b=29;
	else if(!((year%4==0&&year%100!=0)||(year%400==0))&&a==2)
		b=28;
	else if(a==4||a==6||a==9||a==11)
		b=30;
	return(b);
}
int runnian(int n)
{
	if(n%4==0&&n%100!=0)
		return 1;
	else if(n%400==0)
		return 1;
	else
		return 0;
}
int tianshu(int y,int m,int d)
{
	int i,days=0;
	if(runnian(y))
	{
		int md[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
		for(i=0;i<m;i++)
			days+=md[i];
	}
	else
	{
		int md[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
		for(i=0;i<m;i++)
			days+=md[i];
	}
	days+=d;
	return days;
}
int daysbetweendate(int y1,int m1,int d1,int y2,int m2,int d2)
{
	int i,day=0;
	for (i=y1;i<y2;i++)
	{
		if((i%4==0&&i%100!=0)||i%400==0)
			day+=366;
		else day+=365;
	}
	day=day-tianshu(y1,m1,d1)+tianshu(y2,m2,d2);
	return day;
}
int main()
{
	int y1,m1,d1,y2,m2,d2;
	scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
	printf("%d",daysbetweendate(y1,m1,d1,y2,m2,d2));
	return 0;
}
void main()
{
	int year1,year2,month1,month2,day1,day2,s1=0,s2=0,s3=0;
	scanf("%d %d %d\n",&year1,&month1,&day1);
	scanf("%d %d %d",&year2,&month2,&day2);
	int num(int year,int month,int day);
	int laf(int a,int b);
	s1=num(year1,month1,day1);
	s2=num(year2,month2,day2);
	s3=laf(year1,year2);
	printf("%d\n",s3+s2-s1);
}
int num(int year,int month,int day)
{
	int z;
	int sum1(int a,int b);
	int sum2(int a,int b);
	if((year%400==0)||((year%100!=0)&&(year%4==0)))
	   z=sum1(month,day);
    else z=sum2(month,day);
    return(z);
}
int sum1(int a,int b)
{
	int z=0;
	switch(a)
	{
		case 1:z=b;break;
		case 2:z=31+b;break;
		case 3:z=60+b;break;
		case 4:z=91+b;break;
		case 5:z=121+b;break;
		case 6:z=152+b;break;
		case 7:z=182+b;break;
		case 8:z=213+b;break;
		case 9:z=244+b;break;
		case 10:z=274+b;break;
		case 11:z=305+b;break;
		case 12:z=335+b;
	}
	return(z);
}
int sum2(int a,int b)
{
	int z=0;
	switch(a)
	{
		case 1:z=b;break;
		case 2:z=31+b;break;
		case 3:z=59+b;break;
		case 4:z=90+b;break;
		case 5:z=120+b;break;
		case 6:z=151+b;break;
		case 7:z=181+b;break;
		case 8:z=212+b;break;
		case 9:z=243+b;break;
		case 10:z=273+b;break;
		case 11:z=304+b;break;
		case 12:z=334+b;
	}
	return(z);
}
int laf(int a,int b)
{
	int z=0,i;
	for(i=a;i<b;i++)
      {if((i%400==0)||((i%100!=0)&&(i%4==0)))
         z=z+366;
      else z=z+365;}
    return(z);
}
int main()
{int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int y1,y2,m1,m2,d1,d2;
int i,m=0;
int temp;
int s1=0,s2=0;
scanf("%d %d %d",&y1,&m1,&d1);
scanf("%d %d %d",&y2,&m2,&d2);
if(y1==y2){
	for(i=0;i<m1-1;i++)
		s1+=month[i];
	for(i=0;i<m2-1;i++)
		s2+=month[i];
	m=s2-s1+d2-d1;
	if(m<0)
		m=-m;
	printf("%d\n",m);
}
else 
{if(y2-y1<0){
temp=y1;
y1=y2;
y2=temp;
}
for(i=0;i<m1-1;i++)
s1+=month[i];
for(i=0;i<m2-1;i++)
s2+=month[i];
if(m1>2){
	s2+=365;
	y1++;
}
if(m2>2){
	s2-=365;
	y2++;
}
for(i=y1;i<y2;i++){
	if(i%4==0&&i%100!=0||i%400==0)
		s2+=366;
	else 
		s2+=365;
}
printf("%d\n",s2-s1+d2-d1);
}
return 0;
}
int main()
{
	int startYear, startMonth, startDay;
	int endYear, endMonth, endDay;
	int i, days = 0;
	cin >> startYear >> startMonth >> startDay;
	cin >> endYear >> endMonth >> endDay;
	for (i = startYear; i < endYear; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			days += 366;
		else
			days += 365;
	}
	for (i = 1; i < endMonth; i++)
	{
		switch (i)
		{
		case 1:	;
		case 3:	;
		case 5:	;
		case 7:	;
		case 8:	;
		case 10:	;
		case 12:	days += 31;	break;
		case 2:
			{
				if ((endYear % 4 == 0 && endYear % 100 != 0) || (endYear % 400 == 0))
				{
					days += 29;
					break;
				}
				else
				{
					days += 28;	
					break;
				}
			}
		default :	days += 30;	break;
		}
	}
	days += endDay;
	for (i = 1; i < startMonth; i++)
	{
		switch (i)
		{
		case 1:	;
		case 3:	;
		case 5:	;
		case 7:	;
		case 8:	;
		case 10:	;
		case 12:	days -= 31;	break;
		case 2:
			{
				if ((startYear % 4 == 0 && startYear % 100 != 0) || (startYear % 400 == 0))
				{
					days -= 29;	
					break;
				}
				else
				{
					days -= 28;	
					break;
				}
			}
		default :	days -= 30;	break;
		}
	}
	days -= startDay;
	cout << days << endl;
	return 0;
}
int main ()
{
	int month1[13] = {0, 31, 28, 31, 30 ,31, 30 ,31, 31,30,31,30,31};
	int month2[13] = {0, 31, 29, 31, 30 ,31, 30 ,31, 31,30,31,30,31};
	int ye1,mon1,day1,ye2,mon2,day2,sum = 0,i;
	cin >> ye1 >> mon1 >> day1 >> ye2 >> mon2 >> day2;
	if (ye1 == ye2)
	{
		if (mon1 == mon2)
		{
			cout << day2 - day1;
			return 0;
		}
		else 
		{
			if ((ye1% 4 == 0 && ye1 % 100 != 0) || (ye1 % 400 == 0)) 
			{
				sum = sum + month2[mon1] - day1;
				for ( i = mon1 + 1; i< mon2; i++)
				{
					sum = sum + month2[i];
				}
				sum = sum +  day2;
				cout << sum;
			}
			else
			{
				sum = sum + month1[mon1] - day1;
				for ( i = mon1 + 1; i< mon2; i++)
				{
					sum = sum + month1[i];
				}
				sum = sum +  day2;
				cout << sum;
			}
		}
	}
	else
	{
		if ((ye1 % 4 == 0 && ye1 % 100 != 0) || (ye1 % 400 == 0)) 
		{
			sum = sum + month2[mon1] - day1;
			for (i = mon1 + 1; i <= 12; i++)
			{
				sum = sum + month2[i];
			}
		}
		else
		{
			sum = sum + month1[mon1] - day1;
			for (i = mon1 + 1; i <= 12; i++)
			{
				sum = sum + month1[i];
			}
		}
		for (i = ye1 + 1; i<= ye2 - 1; i++)
		{
			if ((i % 4 == 0 && i% 100 != 0) || (i % 400 == 0)) 
				sum = sum + 366;
			else 
				sum = sum + 365;
		}
			if ((ye2 % 4 == 0 && ye2 % 100 != 0) || (ye2 % 400 == 0)) 
		{
			sum = sum + day2;
			for (i = 1; i <= mon2 - 1; i++)
			{
				sum = sum + month2[i];
			}
		}else
		{
			sum = sum + day2;
			for (i = 1; i <= mon2 - 1; i++)
			{
				sum = sum + month1[i];
			}
		}
		cout << sum;
	}
	return 0;
}
void main()
{
    int a[12]={31,29,31,30,31,30,31,31,30,31,30,31};
    int b[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int q,w,e,r,t,y,i,j,z,x=0,c=0,v=0,n=0,m=0;
    scanf("%d%d%d%d%d%d",&q,&w,&e,&r,&t,&y);
    z=r-q;
    	for(i=1;i<z;i++)
    	{
    		if(((q+i)%4==0&&(q+i)%100!=0)||((q+i)%400==0))
    		x=x+366;
    		else
    		x=x+365;
    	}
    	if((q%4==0&&q%100!=0)||(q%400==0))
    	{
    		for(i=w;i<12;i++)
    		c=c+a[i];
    		if(w==2)
    		c=c+29-e;
    		else
    		if(w==4||w==6||w==9||w==11)
    		c=c+30-e;
    		else
    		c=c+31-e;
    	}
    	else
    	{
    		for(i=w;i<12;i++)
    		c=c+b[i];
    		if(w==2)
    		c=c+28-e;
    		else
    		if(w==4||w==6||w==9||w==11)
    		c=c+30-e;
    		else
    		c=c+31-e;
    	}
    	if((r%4==0&&r%100!=0)||(r%400==0))
    	{
    		for(i=0;i<t-1;i++)
    		v=v+a[i];
    		v=v+y;
        }
    	else
    	{
    		for(i=0;i<t-1;i++)
    		v=v+b[i];
    		v=v+y;
    	}
        if(z==0)
        {
        	if((r%4==0&&r%100!=0)||(r%400==0))
            printf("%d",c+v-366);
            else
            printf("%d",c+v-365);
        }
        else
        printf("%d",x+c+v);
}
/*
 * j3.cpp
 *
 *  Created on: 2011-1-9
 *      Author: jsgl
 */
int runnian(int y);
int main()
{
	int y1,m1,d1,y2,m2,d2,D1=0,D2=0,i,j,p=0,t,t1,t2,a,b;
	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	int tianshu[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	for(i=0;i<m1-1;i++)
		D1+=tianshu[i];
	for(j=0;j<m2-1;j++)
		D2+=tianshu[j];
	if(y1==y2&&m1==m2)
		cout<<d2-d1;
	else{
		int s1=365*(y2-y1);
		for(i=y1;i<y2;i++)
		{
			t=runnian(i);
			if(t==1)
				p++;
		}
		int s2=s1+p;
		t1=runnian(y1);
		if(t1==1)
		{
			if(m1>=3)
				a=D1+1+d1;
			else a=D1+d1;
		}
		else a=D1+d1;
		t2=runnian(y2);
		if(t2==1)
		{
			if(m2>=3)
				b=D2+1+d2;
			else b=D2+d2;
		}
		else b=D2+d2;
		cout<<s2+b-a<<endl;
	}
		return 0;
}

int runnian(int y)
{
	if((y%4==0&&y%100!=0)||(y%400==0))
	return 1;
	else return 0;
}
int main()
{
	int startyear,startmonth,startday,endyear,endmonth,endday;
	int total,i,j;
	int A[12],B[12];
	A[0]=31;
	A[1]=28;
	A[2]=31;
	A[3]=30;
	A[4]=31;
	A[5]=30;
	A[6]=31;
	A[7]=31;
	A[8]=30;
	A[9]=31;
	A[10]=30;
	A[11]=31;

    B[0]=31;
	B[1]=29;
	B[2]=31;
	B[3]=30;
	B[4]=31;
	B[5]=30;
	B[6]=31;
	B[7]=31;
	B[8]=30;
	B[9]=31;
	B[10]=30;
	B[11]=31;

	scanf("%d%d%d",&startyear,&startmonth,&startday);
	scanf("%d%d%d",&endyear,&endmonth,&endday);
	total=0;
	for(i=startyear;i<endyear;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0)
		{
			total=total+366;
		}
		else 
		{
			total=total+365;
		}
	}
	if(endyear%4==0&&endyear%100!=0||endyear%400==0)
	{
		if(endmonth>=startmonth)
		{
			for(j=startmonth;j<endmonth;j++)
			{
				total=total+B[j-1];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
		if(endmonth<startmonth)
		{
			for(j=startmonth;j>endmonth;j--)
			{
				total=total-B[j-2];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
	}
	else 
	{
		if(endmonth>=startmonth)
		{
			for(j=startmonth;j<endmonth;j++)
			{
				total=total+A[j-1];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
		if(endmonth<startmonth)
		{
			for(j=startmonth;j>endmonth;j--)
			{
				total=total-A[j-2];
			}
			total=total+endday-startday;
			printf("%d",total);
		}
	}
	return 0;
}
int countyear(int a,int b)
{
				int i,t;
				t=365*(b-a-1);
	for(i=a+1;i<b;i++)
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			t+=1;
		return t;
}
			
			
			
			
			
int countday(int a,int b,int c)
{
	int t;
	switch(b)
	{
	  case 1:if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
			   t=366-c+1;
		   else
			   t=365-c+1;break;
	  case 2:if((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
			   t=366-31-c+1;
		   else
			   t=365-31-c+1;break;
	  case 3:t=31-c+31+30+31+30+31+31+30+31+30+1;break;
	  case 4:t=30-c+31+30+31+30+31+31+30+31+1;break;
	  case 5:t=31-c+31+30+31+30+31+31+30+1;break;
	  case 6:t=30-c+31+30+31+30+31+31+1;break;
	  case 7:t=31-c+31+30+31+30+31+1;break;
	  case 8:t=31-c+31+30+31+30+1;break;
	  case 9:t=30-c+31+30+31+1;break;
	  case 10:t=31-c+31+30+1;break;
	  case 11:t=30-c+31+1;break;
	  case 12:t=31-c+1;break;
	  default:break;
	}
	return t;
}
void main()
{

	int year[2],month[2],day[2],sum,a,b;

	scanf("%d%d%d%d%d%d",&year[0],&month[0],&day[0],&year[1],&month[1],&day[1]);
	if(year[0]==year[1])
	{
		sum=countday(year[0],month[0],day[0]);
		a=countday(year[1],month[1],day[1]);
		sum=sum-a;
	}
	else
	{
		sum=countyear(year[0],year[1]);
		a=countday(year[0],month[0],day[0]);
		b=countday(year[1],month[1],day[1]);
		
		if((year[1] % 4 == 0 && year[1] % 100 != 0) || (year[1] % 400 == 0))
			b=366-b;
		else
			b=365-b;
		sum+=(a+b);
	}
	printf("%d\n",sum);
}
int main()
{  int sy=0,sm=0,sd=0,ey=0,em=0,ed=0,sum1=0,sum2=0,i=0,m1=0,m2=0,c=0,t=0;
    scanf("%d %d %d %d %d %d",&sy,&sm,&sd,&ey,&em,&ed);
    for(i=1;i<sm;i++)
    { switch(i)
     { case 1:
	   case 3:
	   case	5:
		case 7:
		case 8:
		case 10:
		case 12:m1=m1+31;break;
		case 4:
		case 6:
		case 9:
		case 11:m1=m1+30;break;
		case 2:if((sy % 4 == 0 && sy % 100 != 0) || (sy % 400 == 0) )	
		        { m1=m1+29;
					}
				else m1=m1+28;
			
			}
		
		}
		t=(sy-1)/4-(sy-1)/100+(sy-1)/400;
    sum1=(sy-1)*365+t+m1+sd;
     for(i=0;i<em;i++)
    { switch(i)
     { case 1:
	   case 3:
	   case	5:
		case 7:
		case 8:
		case 10:
		case 12:m2=m2+31;break;
		case 4:
		case 6:
		case 9:
		case 11:m2=m2+30;break;
		case 2:if((ey % 4 == 0 && ey % 100 != 0) || (ey % 400 == 0) )	
		        { m2=m2+29;
					}
				else m2=m2+28;
			
			}
		
		}
		t=(ey-1)/4-(ey-1)/100+(ey-1)/400;
		sum2=(ey-1)*365+t+m2+ed;
		c=sum2-sum1;
		printf("%d",c);
    
				return(0);
	}
int main()
{
	int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int y1, m1, d1, y2, m2, d2;
	cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
	int sum = 0, i, j;
	if (y1 == y2 && m1 == m2)
	{
		cout << d2 - d1 << endl;
		return 1;
	}
	if (y1 == y2)
	{
		if ((y1 % 4 == 0 && y1 % 100 != 0) || y1 % 400 == 0)
			month[2] = 29;
		else
			month[2] = 28;
		sum += month[m1] - d1;
		for (i = m1 + 1; i < m2; i++)
		{
			if (i == m2)
			{
				sum += d2;
				break;
			}
			sum += month[i];
		}
		cout << sum + 1 << endl;
		return 1;
	}
	if (y1 != y2)
	{
		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;
						continue;
					}
					sum += month[j];
				}
			}
			else
			{
				if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
					sum += 366;
				else
					sum += 365;
			}
		}
		if ((y2 % 4 == 0 && y2 % 100 != 0) || y2 % 400 == 0)
				month[2] = 29;
			else
				month[2] = 28;
		for (i = 1; i < m2; i++)
			sum += month[i];
		sum += d2;
		cout << sum << endl;
		return 1;
	}
	return 0;
}
int main()
{
	int dayofpmon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int y1,m1,d1,y2,m2,d2;
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	int day=0,i;
	for(i=y1;i<y2;i++)
	{
		if((i%4 == 0 && i % 100 != 0) || (i % 400 == 0))
			day=day+366;
		else
			day=day+365;
	}
	for(i=1;i<m1;i++)
	{
		if(i==2&&((y1 % 4 == 0 && y1 % 100 != 0) || (y1% 400 == 0)))
			day=day-29;
		else
			day=day-dayofpmon[i];
	}
	day=day-d1;
	for(i=1;i<m2;i++)
	{
		if(i==2&&((y2% 4 == 0 && y2% 100 != 0) || (y2% 400 == 0)))
			day=day+29;
		else
			day=day+dayofpmon[i];
	}
	day=day+d2;
	cout<<day;
	return 0;
}
void main ()
{
 int y1,y2,m1,m2,d1,d2;
 int year,m,d,t,te,ta;
 scanf ("%d %d %d",&y1,&m1,&d1);
 scanf ("%d %d %d",&y2,&m2,&d2);
 t=(y2-y1)*365;
 te=d1;
 m1=m1-1;
 switch (m1)
 {
 case 11: te=te+30;
 case 10: te=te+31;
 case 9: te=te+30;
 case 8: te=te+31;
 case 7: te=te+31;
 case 6: te=te+30;
 case 5: te=te+31;
 case 4: te=te+30;
 case 3: te=te+31;
 case 2: te=te+28;
 case 1: te=te+31;
 case 0: ;
 }
 ta=d2;
 m2=m2-1;
 switch (m2)
 {
 case 11: ta=ta+30;
 case 10: ta=ta+31;
 case 9: ta=ta+30;
 case 8: ta=ta+31;
 case 7: ta=ta+31;
 case 6: ta=ta+30;
 case 5: ta=ta+31;
 case 4: ta=ta+30;
 case 3: ta=ta+31;
 case 2: ta=ta+28;
 case 1: ta=ta+31;
 case 0: ;
 }
 t=t-te+ta;
 year=y1;
 while (year<y2)
 {
 if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ++t;
 ++year; 
 }
 year=y1;
 if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
   if (m1>2)  t=t-1;
 year=y2;
 if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
   if (m2>2)  t=t+1;
 printf ("%d",t); 
}
int main()
{
	int a1,b1,c1,a2,b2,c2;
	int ans,now,md;
	scanf("%d%d%d",&a1,&b1,&c1);
	scanf("%d%d%d",&a2,&b2,&c2);
	if (a1==a2&&b1==b2) ans=c2-c1;
	else {
		if (b1==1||b1==3||b1==5||b1==7||b1==8||b1==10||b1==12) md=31;
		if (b1==4||b1==6||b1==9||b1==11) md=30;
		if (b1==2) {
			if ((a1 % 4 == 0 && a1 % 100 != 0) || (a1 % 400 == 0)) md=29;
				else md=28;
		}
		ans=md-c1;
	}
	now=b1+1;
	while ((now<b2||a1<a2)&&(now<=12)){
		if (now==1||now==3||now==5||now==7||now==8||now==10||now==12) md=31;
		if (now==4||now==6||now==9||now==11) md=30;
		if (now==2) {
			if ((a1 % 4 == 0 && a1 % 100 != 0) || (a1 % 400 == 0)) md=29;
				else md=28;
		}
		ans=ans+md;
		now++;
	}
	now=a1+1;
	while (now<a2){
		ans=ans+365;
		if ((now % 4 == 0 && now % 100 != 0) || (now % 400 == 0)) ans++;
		now++;
	}
	if (a1<a2){
	now=1;
	while (now<b2){
		if (now==1||now==3||now==5||now==7||now==8||now==10||now==12) md=31;
		if (now==4||now==6||now==9||now==11) md=30;
		if (now==2) {
			if ((a2 % 4 == 0 && a2 % 100 != 0) || (a2 % 400 == 0)) md=29;
				else md=28;
		}
		ans=ans+md;
		now++;
	}
	}
	if (a1<a2||b1<b2) ans=ans+c2;
	printf("%d\n",ans);
	return 0;
}