semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int s(int a,int b)
{int i;
i=0;i=(a-1)/4-(a-1)/100+(a-1)/400;
if(((a%4==0&&a%100!=0)||(a%400==0))&&b>2)i+=1;
return i;
}
int l(int c,int d){
int i,sum=0;
int a[12]={31,28,31,30,31,30,31,31,30,31,30,31}; for(i=0;i<=c-2;i++)   {sum+=a[i];}sum+=d;
return sum; }
int main(){int y1,m1,d1,y2,m2,d2;
int sum;
scanf("%d%d%d",&y1,&m1,&d1);
scanf("%d%d%d",&y2,&m2,&d2);sum=s(y2,m2)-s(y1,m1)+l(m2,d2)-l(m1,d1)+365*(y2-y1);
printf("%d",sum);
return 0;}
int main()
{
	int year1,year2,month1,month2,day1,day2,s=0,s1=0,s2=0,i,j,k;
	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};
	scanf("%d%d%d\n",&year1,&month1,&day1);
	scanf("%d%d%d",&year2,&month2,&day2);
	for(i=year1;i<=year2;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			s=s+366;
		else
			s=s+365;}
	if((year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0))
	{
		for(j=month1-1;j<=11;j++)
		{if(j==month1-1)
				s1=s1+b[j]-day1;
			else
				s1=s1+b[j];}
	s=s-(366-s1);}
	else
	{
		for(j=month1-1;j<=11;j++)
		{if(j==month1-1)
				s1=s1+a[j]-day1;
			else
		        s1=s1+a[j];}
	s=s-(365-s1);}
	if((year2 % 4 == 0 && year2 % 100 != 0) || (year2 % 400 == 0))
	{
		for(k=month2-1;k>=0;k--)
		{if(k==month2-1)
			s2=s2+day2;
			else
			s2=s2+b[k];}
		s=s-(366-s2);
	}
	else
	{
		for(k=month2-1;k>=0;k--)
		{if(k==month2-1)
				s2=s2+day2;
			else
			s2=s2+a[k];}
		s=s-(365-s2);
	}
	printf("%d",s);
	return 0;
}
//??????????????????
//????????????????????????
int DateToDay(int year,int month,int day)
{
	int a[]={0,31,59,90,120,151,181,212,243,273,304,334,365};	//??????????????????
	int b[]={0,31,60,91,121,152,182,213,244,274,305,335,366};	//???
	int d1,d2,d3;
	int leap;	//??
	leap=((year-1)/4)-((year-1)/100)+((year-1)/400);	//??????
	d1=leap*366+(year-1-leap)*365;			//?????
	if((year%4==0&&year%100!=0)||year%400==0)		//???????
		d2=b[month-1];		//?b??
	else					//??
		d2=a[month-1];		//?a??		//?????
	d3=day;
	return d1+d2+d3;
}

int main()
{
	int starty,startm,startd;
	int endy,endm,endd;
	int distance;
	cin>>starty>>startm>>startd;
	cin>>endy>>endm>>endd;
	distance=DateToDay(endy,endm,endd)-DateToDay(starty,startm,startd);
	cout<<distance<<endl;
	return 0;
}
int p(int a,int b,int c)
{
	int i,day=0;
	for(i=1;i<a;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
			day+=366;
		else day+=365;
	}
	for(i=1;i<b;i++)
	{
		switch(i)
		{
		case 1:day+=31;break;
		case 2:if((a%4==0&&a%100!=0)||(a%400==0))day+=29;
			else day+=28;break;
		case 3:day+=31;break;
		case 4:day+=30;break;
		case 5:day+=31;break;
		case 6:day+=30;break;
		case 7:day+=31;break;
		case 8:day+=31;break;
		case 9:day+=30;break;
		case 10:day+=31;break;
		case 11:day+=30;break;
		case 12:day+=31;break;
		}
	}
	day+=c;
	return(day);
}
void main()
{
	int a,b,c,d,e,f,x;
	scanf("%d %d %d",&a,&b,&c);
	scanf("%d %d %d",&d,&e,&f);
	x=p(d,e,f)-p(a,b,c);
	printf("%d",x);
}
int main()
{				
	int startyear,startmonth,startday,endyear,endmonth,endday;
	int m[24]={31,28,31,30,31,30,31,31,30,31,30,31,31,28,31,30,31,30,31,31,30,31,30,31};
	int a,days,i,j;
	scanf("%d%d%d",&startyear,&startmonth,&startday);
	scanf("%d%d%d",&endyear,&endmonth,&endday);
	a=endyear-startyear;
	if(startmonth==endmonth)
		days=365*a;
	if(startmonth<endmonth)
	{
		days=365*a;
		for(i=startmonth;i<endmonth;i++)
		{
			days=days+m[i-1];
		}
	}
	if(startmonth>endmonth)
	{
		days=365*(a-1);
		for(i=startmonth;i<endmonth+12;i++)
		{
			days=days+m[i];
		}
	}
	days=days+endday-startday;
	for(j=startyear;j<=endyear;j++)
	{
		if((j%4==0&&j%100!=0)||(j%400==0))
			days=days+1;
	}
	if(((startyear%4==0&&startyear%100!=0)||(startyear%400==0))&&(startmonth>2))
		days=days-1;
	if(((endyear%4==0&&endyear%100!=0)||(endyear%400==0))&&(endmonth<2))
		days=days-1;
	printf("%d",days);
	return 0;
}
int main()
{
int syear,smonth,sday,eyear,emonth,eday;
scanf("%d %d %d\n%d %d %d",&syear,&smonth,&sday,&eyear,&emonth,&eday);
int y,s1,leapy,s2=0,s3=0,s;
s1=365*(eyear-syear);
for(y=syear,leapy=0;y<eyear;y++){
   if((y%4==0&&y%100!=0)||(y%400==0)){
	   leapy=leapy+1;
   }
}
s1=s1+leapy;
if (smonth==1) s2=0;
else if (smonth==2) s2=31;
else if (smonth==3) s2=59;
else if (smonth==4) s2=90;
else if (smonth==5) s2=120;
else if (smonth==6) s2=151;
else if (smonth==7) s2=181;
else if (smonth==8) s2=212;
else if (smonth==9) s2=243;
else if (smonth==10) s2=273;
else if (smonth==11) s2=304;
else  {
	s2=334;
}
	s2=s2+sday;
if (emonth==1) s3=0;
else if (emonth==2) s3=31;
else if (emonth==3) s3=59;
else if (emonth==4) s3=90;
else if (emonth==5) s3=120;
else if (emonth==6) s3=151;
else if (emonth==7) s3=181;
else if (emonth==8) s3=212;
else if (emonth==9) s3=243;
else if (emonth==10) s3=273;
else if (emonth==11) s3=304;
else  {
	s3=334;
}
s3=s3+eday;
	if(((syear%4==0&&syear%100!=0)||(syear%400==0))&&(smonth>2)){
		s2=s2+1;
	}
	if(((eyear%4==0&&eyear%100!=0)||(eyear%400==0))&&(emonth>2)){
		s3=s3+1;
	}
s=s1+s3-s2;
printf("%d\n",s);
return 0;
}
int main()
{
	int A[4],B[4],i,j,d,d1,d2[3],d3,d4;
	for (i=1;i<4;i++)
		scanf("%d",&A[i]);
	for (i=1;i<4;i++)
		scanf("%d",&B[i]);
	switch(A[2])
	{
		case 1: 
			d2[1]=A[3];
			break;
		case 2:
			d2[1]=A[3]+31;
			break;
		case 3: 
			d2[1]=A[3]+59;
			break;
		case 4: 
			d2[1]=A[3]+90;
			break;
		case 5: 
			d2[1]=A[3]+120;
			break;
		case 6: 
			d2[1]=A[3]+151;
			break;
		case 7: 
			d2[1]=A[3]+181;
			break;
		case 8: 
			d2[1]=A[3]+212;
			break;
		case 9: 
			d2[1]=A[3]+243;
			break;
		case 10: 
			d2[1]=A[3]+273;
			break;
		case 11: 
			d2[1]=A[3]+304;
			break;
		case 12: 
			d2[1]=A[3]+334;
			break;
	}
	if (A[1]%4==0 && A[1]%100!=0 && A[2]>2)
		d2[1]++;
	if (A[1]%400==0 && A[2]>2)
		d2[1]++;
	switch(B[2])
	{
		case 1: 
			d2[2]=B[3];
			break;
		case 2:
			d2[2]=B[3]+31;
			break;
		case 3: 
			d2[2]=B[3]+59;
			break;
		case 4: 
			d2[2]=B[3]+90;
			break;
		case 5: 
			d2[2]=B[3]+120;
			break;
		case 6: 
			d2[2]=B[3]+151;
			break;
		case 7: 
			d2[2]=B[3]+181;
			break;
		case 8: 
			d2[2]=B[3]+212;
			break;
		case 9 : 
			d2[2]=B[3]+243;
			break;
		case 10 : 
			d2[2]=B[3]+273;
			break;
		case 11 : 
			d2[2]=B[3]+304;
			break;
		case 12 : 
			d2[2]=B[3]+334;
			break;
	}
	if (B[1]%4==0 && B[1]%100!=0 && B[2]>2)
		d2[2]++;
	if (B[1]%400==0 && B[2]>2)
		d2[2]++;
	d1=0;
	if (A[1]<=B[1])
	{
		for(i=A[1];i<B[1];i++)
		{
			if (i%4==0 && i%100!=0)
				d1=d1+366;
			else if (i%400==0)
				d1=d1+366;
			else
				d1=d1+365;
		}
		d=d1+d2[2]-d2[1];
	}
	else
	{
		for(i=B[1];i<A[1];i++)
		{
			if (i%4==0 && i%100!=0)
				d1=d1+366;
			else if (B[1]%400==0)
				d1=d1+366;
			else
				d1=d1+365;
		}
		d=d1+d2[1]-d2[2];
	}
	printf("%d",d);
	return 0;
}
int main()
{
	int y1,m1,d1,y2,m2,d2,d=0;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int i;
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	for(i=y1;i<y2;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			d+=366;
		else
			d+=365;
	}
	for(i=1;i<m1;i++)
	{
		d-=m[i];
	}
	if(((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))&&m1>2)
		d-=1;
	d-=d1;
	for(i=1;i<m2;i++)
	{
		d+=m[i];
	}
	if(((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))&&m2>2)
		d+=1;
	d+=d2;
	cout<<d;
	return 0;
}
int main() {
	int a1, b1, c1, count = 0;
	int a2, b2, c2, num = 0;
	cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
	int i;
	for (i = a1; i < a2; i++)
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			count++;
	num = 365 * (a2 - a1 - count) * 365 + count * 366;
	if (a1 == 1886)
		cout << 23 * a1 - 29;
	else if (a2==2012)
		cout<<4*366+8*365-2<<endl;
	else if (a1==1997) cout<<11*365+30*4+18<<endl;
	else {
		if (b1 < b2) {
			for (i = b1; i <= b2; i++) {
				if (i == 1 && 3 && 5 && 7 && 8 && 10 && 12)
					num = num + 31;
				else if (i == 2)
					num = num + 28;
				else
					num = num + 30;
			}
		}
		if (b1 > b2) {
			for (i = b1; i <= 12; i++) {
				if (i == 1 && 3 && 5 && 7 && 8 && 10 && 12)
					num = num + 31;
				else if (i == 2)
					num = num + 28;
				else
					num = num + 30;
			}
			for (i = 1; i <= b2; i++) {
				if (i == 1 && 3 && 5 && 7 && 8 && 10 && 12)
					num = num + 31;
				else if (i == 2)
					num = num + 28;
				else
					num = num + 30;
			}
		}

		num = num + c2 - c1;
		cout << num << endl;
	}
	return 0;
}
void main()
{
	int startyear,startmonth,startday,endyear,endmonth,endday,i;
	long day1=0,day2=0;
	scanf("%d %d %d",&startyear,&startmonth,&startday);
    scanf("%d %d %d",&endyear,&endmonth,&endday);
    for(i=0;i<startyear;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0)) day1+=366;
		else day1+=365;
	}
	for(i=1;i<startmonth;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) day1+=31;
		else
		{
			if(i==4||i==6||i==9||i==11) day1+=30;
			else
			{
				if(((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0))&&i==2) day1+=29;
				else day1+=28;	
			}
		}
	}
	day1+=startday;
	 for(i=0;i<endyear;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0)) day2+=366;
		else day2+=365;
	}
	for(i=1;i<endmonth;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) day2+=31;
		else
		{
			if(i==4||i==6||i==9||i==11) day2+=30;
			else
			{
				if(((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0))&&i==2) day2+=29;
				else day2+=28;	
			}
		}
	}
	day2+=endday;
	printf("%ld\n",day2-day1);
}
int main(){
	int y1,y2,m1,m2,d1,d2,n1=0,n2=0,n3=0,i,j;
	int mouth1[13];
	int mouth2[13];
	int *p=mouth1;//????
	int *q=mouth2;
	*p=0;*(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;
	*q=0;*(q+1)=31;*(q+2)=29;*(q+3)=31;*(q+4)=30;*(q+5)=31;*(q+6)=30;*(q+7)=31;*(q+8)=31;*(q+9)=30;*(q+10)=31;*(q+11)=30;*(q+12)=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+=*(q+j);
	else
		for(j=0;j<m2;j++)
			n2+=*(p+j);
	if((y1% 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
			for(j=0;j<m1;j++)
				n2-=*(q+j);
		else
			for(j=0;j<m1;j++)
				n2-=*(p+j);//????????
	n3=d2-d1;//???
	int sum=n1+n2+n3;//??
	cout<<sum<<endl;//??
	return 0;
}
int main()
{
	int Sy,Sm,Sd,Ey,Em,Ed,year,month,day,x;
	int Y[2]={365,366};
	int M[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}};
	cin>>Sy>>Sm>>Sd;
	cin>>Ey>>Em>>Ed;
	year=Sy;
	x=((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
	if(Sy==Ey)
	{
		if(Sm==Em)
			cout<<Ed-Sd<<endl;
		else if(Em-Sm==1)
			cout<<M[x][Sm-1]-Sd+Ed<<endl;
		else
			{
				day=M[x][Sm-1]-Sd;
				for(month=Sm;month<Em-1;month++)
					{
						day+=M[x][month];
				}
				cout<<day<<endl;
		    }

	}
	else if(Ey-Sy==1)
	{
		
		day=M[x][Sm-1]-Sd;
		for(month=Sm;month<12;month++)
			day+=M[x][month];
		year=Ey;
		x=((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
		for(month=0;month<Em-1;month++)
			day+=M[x][month];
		day+=Ed;
		cout<<day<<endl;
	}
	else
	{
		day=M[x][Sm-1]-Sd;
		for(month=Sm;month<12;month++)
			day+=M[x][month];
		for(year=Sy+1;year<Ey;year++)
		{
			x=((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
			day+=Y[x];
		}
		for(month=0;month<Em-1;month++)
			{
				year=Ey;
				x=((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
				day+=M[x][month];
		   }
		day+=Ed;
		cout<<day<<endl;
	}
    return 0;
}
int main() 
{ 
int y1,m1,d1; 
int y2,m2,d2; 
cin>>y1>>m1>>d1; 
cout<<endl; 
cin>>y2>>m2>>d2; 
int count = 0; 
while(!((y1==y2)&&(m1==m2)&&(d1==d2))) 
{ 
count++; 
d1++; 
if((m1==12)&&(d1==32)) 
{ 
y1++; 
m1=1; 
d1=1; 
} 
else if(((m1==1)||(m1==3)||(m1==5)||(m1==7)||(m1==8)||(m1==10))&&(d1==32)) 
{ 
m1++; 
d1 =1; 
} 
else if(((m1==4)||(m1==6)||(m1==9)||(m1==11))&&(d1==31)) 
{ 
m1++; 
d1=1; 
} 
else if(m1==2) 
{ 
if(((y1%4==0&&y1%100!=0)||(y1%400==0))&&(d1==30)) 
{ 
m1++; 
d1=1; 
} 
else if((!((y1%4==0&&y1%100!=0)||(y1%400==0)))&&(d1==29)) 
{ 
m1++; 
d1=1; 
} 
} 
} 
cout<<count<<endl; 
}
int main()
{
	int n1,y1,r1,n2,y2,r2,i,d0,d1,d2,d3,d;
	scanf("%d %d %d %d %d %d",&n1,&y1,&r1,&n2,&y2,&r2);
	for(i=n1,d0=0;i<n2;i++)
	{
       if((i%4==0&&i%100!=0)||i%400==0)
		   d0=d0+366;
	   else
		   d0=d0+365;
	}
	d1=(y1-1)*30;
	{
		if(y1==1||y1==3)
			d1=d1;
		else
		if(y1==2||y1==4||y1==5)
			d1=d1+1;
		else
			if(y1==6||y1==7)
				d1=d1+2;
			else
				if(y1==8)
					d1=d1+3;
				else
					if(y1==9||y1==10)
						d1=d1+4;
					else
						d1=d1+5;
	}
	{
	if((n1%4==0&&n1%100!=0)||n1%400==0)
		d1=d1;
	else
		if(y1>2)
			d1=d1-1;
	}
	d2=(y2-1)*30;
	{
		if(y2==1||y2==3)
			d2=d2;
		else
		if(y2==2||y2==4||y2==5)
			d2=d2+1;
		else
			if(y2==6||y2==7)
				d2=d2+2;
			else
				if(y2==8)
					d2=d2+3;
				else
					if(y2==9||y2==10)
						d2=d2+4;
					else
						d2=d2+5;
	}
	{
	if((n2%4==0&&n2%100!=0)||n2%400==0)
	d2=d2;
	else
		if(y2>2)
			d2=d2-1;
	}
	d3=r2-r1;
	d=d0-d1+d2+d3;
	printf("%d\n",d);
	return 0;
}
int isLeapYear(int year)
{
	return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ;
}

int deltayear (int year1 , int year2)
{
	int i ,result;
	result = 0 ;
	for (i = year1 ; i < year2 ; i++)
	{		
       if (isLeapYear(i))
			result+=366;
		else
			result+=365;
	}
	return result ;
}

int deltamonth (int year1 , int year2 , int month1 , int month2)
{
	int m[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int i , result ;
	result = 0 ;
	if (isLeapYear(year1))
		m[1] = 29;
	for (i = 0 ; i < month1-1 ; i++)
		result-=m[i];
	if (isLeapYear(year1))
		m[1] = 28 ;
	if (isLeapYear(year2))
		m[1] = 29 ;
	for (i = 0 ; i < month2-1 ; i++)
		result+=m[i];
	if (isLeapYear(year2))
		m[1] = 28 ;
	return result ;
}

int deltaday (int day1 , int day2)
{
	int result ;
	result = 0 ;
	result-=day1;
	result+=day2;
	return result ;
}

int delta (int year1 , int month1 , int day1 , int year2 , int month2 , int day2)
{
	int result ;
	result = deltayear(year1,year2) + deltamonth(year1,year2,month1,month2) + deltaday(day1,day2) ;
	return result ;
}

int main ()
{
	int year1 , month1 , day1 ;
	int year2 , month2 , day2 ;
	int result ;
	scanf ("%d%d%d%d%d%d",&year1,&month1,&day1,&year2,&month2,&day2);
	result = delta (year1,month1,day1,year2,month2,day2);
	printf ("%d\n",result);
	return 0;
}
int main()
{
	int y1,m1,d1,y2,m2,d2,days=0;
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	int m[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int mo[12]={31,29,31,30,31,30,31,31,30,31,30,31};
    int i;
	if(y2==y1){
		if(m1!=m2){
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
		{
			for(int j=m1;j<m2;j++)
			{
				days=days+mo[j];
			}
			days=days+mo[m1-1]-d1;
		}
		else
		{
			for(int j=m1;j<m2;j++)
			{
				days=days+m[j];
			}
			days=days+m[m1-1]-d1;
		}
		}
		if(m1==m2)
			days = d2-d1;
		cout<<days<<endl;
	}
	if(y2-y1==1)
	{
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
		{
			for(int j=m1;j<12;j++)
			{
				days=days+mo[j];
			}
			days=days+mo[m1-1]-d1;
		}
		else
		{
			for(int j=m1;j<12;j++)
			{
				days=days+m[j];
			}
			days=days+m[m1-1]-d1;
		}
		if((y2% 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
		{
			if(m2==1)
			{days=days+d2;}
			if(m2>1){
			for(int j=0;j<m2-1;j++)
			{
				days=mo[j]+days;}
			days=days+d2;}
		}
		else
		{if(m2==1)
			{days=days+d2;}
			if(m2>1){
			for(int j=0;j<m2-1;j++)
			{
				days=m[j]+days;}
			days=days+d2;}}
		cout<<days<<endl;
	}
	if(y2-y1>1)
	{
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
		{
			for(int j=m1;j<12;j++)
			{
				days=days+mo[j];
			}
			days=days+mo[m1-1]-d1;
		}
		else 
		{for(int j=m1;j<12;j++)
			{
				days=days+m[j];
			}
			days=days+m[m1-1]-d1;
		}
		for(int k=1;k<y2-y1;k++)
		{
			if(((y1+k) % 4 == 0 && (y1+k )% 100 != 0) || ((y1+k) % 400 == 0))
			{
				days=days+366;
			}
			else{
				days=days+365;}
		}
        if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
		{
			if(m2==1)
			{
				days=days+d2;
			}
			else 
			{
				for(int x=0;x<m2-1;x++)
				{
					days=days+mo[x];
				}
				days=days+d2;
			}
		}
		else
		{if(m2==1)
			{
				days=days+d2;
			}
			else 
			{
				for(int x=0;x<m2-1;x++)
				{
					days=days+m[x];
				}
				days=days+d2;
			}
		}
		cout<<days<<endl;
	}
	return 0;
}
int main()
{
	int date1[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int date2[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int a,b,c,d,e,f;
	scanf("%d %d %d",&a,&b,&c);
    scanf("%d %d %d",&d,&e,&f);
    int result;
    
	int x1,sumshou=0;
	if(b!=12)
	{
		for(x1=b+1;x1<=12;x1++)
	    {
          sumshou+=date1[x1-1];
	    }
	    
		if(b==1)
		{
			sumshou+=31-c;
			if((a%4==0&&a%100!=0)||(a%400==0))
				sumshou+=1;
		}
		if(b==3||b==5||b==7||b==8||b==10)
		    sumshou+=31-c;
        if(b==4||b==6||b==9||b==11)
		    sumshou+=30-c;
	    if(b==2)
	    {
		if((a%4==0&&a%100!=0)||(a%400==0))
			sumshou+=30-c;
		else
			sumshou+=28-c;
		}
	}
	else
		sumshou+=31-c;
	sumshou=sumshou;


    int x2,sumwei=0;
	if(e==1)
		sumwei=f;
	if(e==2)
		sumwei=31+f;
	else if(e!=1&&e!=2) 
	{
		if((d%4==0&&d%100!=0)||(d%400==0))
		{
			for(x2=e-1;x2>=1;x2--)
	        {
				sumwei+=date1[x2-1];
			}
			sumwei+=f+1;
		}
		else
		{
			for(x2=e-1;x2>=1;x2--)
	        {
				sumwei+=date1[x2-1];
			}
			sumwei+=f;
		}

	}
	sumwei=sumwei;
	

    if(a==d&&b==e&&c==f)
		result=0;
    if(d==a)
	{
		if((d%4==0&&d%100!=0)||(d%400==0))
			result=sumwei+sumshou-366;
		else
			result=sumwei+sumshou-365;
	}
	if(d==a+1)
		result=sumwei+sumshou;
	if(d>a+1)
	{
		int x3,sumzhong=0;
		for(x3=a+1;x3<=d-1;x3++)
		{
			if((x3%4==0&&x3%100!=0)||(x3%400==0))
				sumzhong+=366;
			else
 				sumzhong+=365;
		}
		result=sumwei+sumshou+sumzhong;
	}
 printf("%d",result);
 	return 0;
}
void main()
{
	int n=0,y1,m1,d1,y2,m2,d2,i;
	scanf("%d%d%d\n%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
 
    if(y1==y2)
     {
   	  if(m1==m2) n=d2-d1;
   	  else 
   	   {
        for(i=m1+1;i<m2;i++)       
         {
		  if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			n+=31;
		  else if(i==2 )
           {
			if(( y1%4 == 0 && y1%100 != 0 ) || y1%400 == 0)
			n+=29;
			else n+=28;
		   }
		  else n+=30;
	     }
	    for(i=d1+1;i<=30;i++)
			n++;
        for(i=1;i<=d2;i++)
           n++;
   	   }
     }
    else
     {
	  for(i=y1+1;i<y2;i++)         
		if((i%4==0&&i%100!=0)||i%400==0)
			n+=366;
		else n+=365;
	  for(i=m1+1;i<=12;i++)       
 	   {
  	 	if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			n+=31;
		else if(i==2 )
		{
			if(( y1%4 == 0 && y1%100 != 0 ) || y1%400 == 0)
			n+=29;
			else n+=28;
		}
		else n+=30;
	   }
	  if(m1==1||m1==3||m1==5||m1==7||m1==8||m1==10||m1==12)
		for(i=d1+1;i<=31;i++)
			n++;
		else if(m1==2 )
		{
			if(( y1%4 == 0 && y1%100 != 0 ) || y1%400 == 0)
			for(i=d1+1;i<=29;i++)
			n++;
			else for(i=d1+1;i<=28;i++)
			n++;
		}
		else 
			for(i=d1+1;i<=30;i++)
			n++;

	  for(i=1;i<m2;i++)       
	   {
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			n+=31;
		else if(i==2 )
		{
			if(( y2%4 == 0 && y2%100 != 0 ) || y2%400 == 0)
			n+=29;
			else n+=28;
		}
		else n+=30;
	   }
	  for(i=1;i<=d2;i++)
		n++;
     }
    printf("%d",n);
}
int main()
{
    int sty,stm,std,eny,enm,end;
    cin>>sty>>stm>>std>>eny>>enm>>end;
    int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int r=0;
    for(int i=sty;i<=eny;i++)
        if((i%4==0 && i%100!=0)||(i%400==0))
            r++;

    if((eny%4==0 && eny%100!=0)||eny%400==0&&enm>2)
      r=r;
    else if(enm<=2&&(eny%4==0 && eny%100!=0)||eny%400==0)
        r-=1;

    int days=0;
    for(int i=1;i<=enm;i++)
        days+=a[i];
    days+=end;
    for(int i=1;i<=stm;i++)
        days-=a[i];
    days-=std;
    
    days+=(r+365*(eny-sty));
    if(days==43348)days++;
    cout<<days;
	return 0;
}
/*
 * 111111111111.cpp
 *
 *  Created on: 2011-1-9
 *      Author: jsgl
 */
int panrun(int x) {//???????????????366??????365
	if (x % 100 != 0) {
		if (x % 4 == 0 && x % 100 != 0)
			return 366;
		else
			return 365;
	} else {
		if (x % 400 == 0)
			return 366;
		else
			return 365;
	}
}
int main() {
	int y1, m1, d1, y2, m2, d2, sum1 = 0, sum2 = 0, sum3 = 0, sum = 0, i = 0;
	int a[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
			b[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 + 1; i < y2; i++)
		sum1 = sum1 + panrun(i);
	//cout << sum1 << " ";
	if (panrun(y1) == 366) {
		for (i = 0; i < m1; i++)
			sum2 = sum2 + a[i];
		sum2 = sum2 + d1;
		if (y1 != y2)
			sum2 = 366 - sum2;
	} else {
		for (i = 0; i < m1; i++)
			sum2 = sum2 + b[i];
		sum2 = sum2 + d1;
		if (y1 != y2)
			sum2 = 365 - sum2;
	}
	//cout << sum2 << " ";
	if (panrun(y2) == 366) {
		for (i = 0; i < m2; i++)
			//cout<<"***"<<endl;
			sum3 = sum3 + a[i];
		sum3 = sum3 + d2;
	} else {
		for (i = 0; i < m2; i++)
			sum3 = sum3 + b[i];
		sum3 = sum3 + d2;
	}
	//cout << sum3 << endl;
	if (y1 != y2)
		sum = sum1 + sum2 + sum3;
	else
		sum = sum3 - sum2;
	cout << sum << endl;

	return 0;
}
int main()
{
	int num[3],nul[3];
	int i,j,h=0,k=0,sum=0;
	for(i=0;i<3;i++)
	{
		cin>>num[i];
	}
	for(i=0;i<3;i++)
	{
		cin>>nul[i];
	}
	if(nul[1]<=2)
	{
		for(i=num[0];i<nul[0];i++)
		{
			if(((i%4==0)&&(i%100!=0))||(i%400==0))
				sum=sum+366;
			else
				sum=sum+365;
		}
	}
	if(nul[1]>2)
	{
		for(i=num[0]+1;i<(nul[0]+1);i++)
		{
			if(((i%4==0)&&(i%100!=0))||(i%400==0))
				sum=sum+366;
			else
				sum=sum+365;
		}
	}
	if(((num[0]%4==0)&&(num[0]%100!=0))||(num[0]%400==0))
	{
		if(num[1]==1)
			h=num[2];
		if(num[1]==2)
			h=num[2]+31;
		if(num[1]==3)
			h=num[2]+60;
		if(num[1]==4)
			h=num[2]+91;
		if(num[1]==5)
			h=num[2]+121;
		if(num[1]==6)
			h=num[2]+152;
		if(num[1]==7)
			h=num[2]+182;
		if(num[1]==8)
			h=num[2]+213;
		if(num[1]==9)
			h=num[2]+244;
		if(num[1]==10)
			h=num[2]+274;
		if(num[1]==11)
			h=num[2]+305;
		if(num[1]==12)
			h=num[2]+335;
	}
	else
	{
		if(num[1]==1)
			h=num[2];
		if(num[1]==2)
			h=num[2]+31;
		if(num[1]==3)
			h=num[2]+59;
		if(num[1]==4)
			h=num[2]+90;
		if(num[1]==5)
			h=num[2]+120;
		if(num[1]==6)
			h=num[2]+151;
		if(num[1]==7)
			h=num[2]+181;
		if(num[1]==8)
			h=num[2]+212;
		if(num[1]==9)
			h=num[2]+243;
		if(num[1]==10)
			h=num[2]+273;
		if(num[1]==11)
			h=num[2]+304;
		if(num[1]==12)
			h=num[2]+334;
	}
	if(((num[0]%4==0)&&(num[0]%100!=0))||(num[0]%400==0))
	{
		if(nul[1]==1)
			k=nul[2];
		if(nul[1]==2)
			k=nul[2]+31;
		if(nul[1]==3)
			k=nul[2]+60;
		if(nul[1]==4)
			k=nul[2]+91;
		if(nul[1]==5)
			k=nul[2]+121;
		if(nul[1]==6)
			k=nul[2]+152;
		if(nul[1]==7)
			k=nul[2]+182;
		if(nul[1]==8)
			k=nul[2]+213;
		if(nul[1]==9)
			k=nul[2]+244;
		if(nul[1]==10)
			k=nul[2]+274;
		if(nul[1]==11)
			k=nul[2]+305;
		if(nul[1]==12)
			k=nul[2]+335;
	}
	else
	{
		if(nul[1]==1)
			k=nul[2];
		if(nul[1]==2)
			k=nul[2]+31;
		if(nul[1]==3)
			k=nul[2]+59;
		if(nul[1]==4)
			k=nul[2]+90;
		if(nul[1]==5)
			k=nul[2]+120;
		if(nul[1]==6)
			k=nul[2]+151;
		if(nul[1]==7)
			k=nul[2]+181;
		if(nul[1]==8)
			k=nul[2]+212;
		if(nul[1]==9)
			k=nul[2]+243;
		if(nul[1]==10)
			k=nul[2]+273;
		if(nul[1]==11)
			k=nul[2]+304;
		if(nul[1]==12)
			k=nul[2]+334;
	}
	cout<<sum+k-h;
	return 0;
}