semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int leap_days[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int sum,sum1,sum2;
	int startyear,startmonth,startday,endyear,endmonth,endday;
	scanf("%d %d %d\n%d %d %d",&startyear,&startmonth,&startday,&endyear,&endmonth,&endday);
	int totalfromfirstday (int year1,int month1,int day1,int year2,int month2,int day2);
    sum1=totalfromfirstday(startyear,1,1,startyear,startmonth,startday);
	sum2=totalfromfirstday(startyear,1,1,endyear,endmonth,endday);
	sum=sum2-sum1;
	printf("%d",sum);
}
int totalfromfirstday (int year1,int month1,int day1,int year2,int month2,int day2)
{
	int i,j,sum;
	int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int leap_days[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	sum=day2;
	for (i=1;i<month2;i++)
	{
		if(((year2)%4==0&&(year2)%100!=0)||((year2)%400==0))
			sum=sum+leap_days[i];
		else 
			sum=sum+days[i];
	}
	for (j=year1;j<year2;j++)
	{
		if ((j%4==0&&j%100!=0)||(j%400==0))
			sum=sum+366;
		else sum=sum+365;
	}
	return (sum);
}
int main ()
{
	int year[2], month[2], day[2], i;
	for (i = 0; i < 2; i++ )
	{
		cin >> year[i] >> month[i]>> day[i];
	}
	int sum_days = 0;
	for (i = year[0]; i < year[1]; i++ )
	{
		sum_days += 365 + ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0);
	}
	int mon[12] = {0, 31, 28, 31,30, 31, 30, 31, 31, 30, 31, 30};
	sum_days -= day[0];
	month[0]-- ;
	while (month[0] > 0)
	{
		if (month[0] == 2)
		{
			sum_days -= mon[month[0]] +((year[0] % 4 == 0 && year[0] % 100 != 0) || year[0] % 400 == 0);
		}
		else
		{
			sum_days -= mon[month[0]];
		}
		month[0]-- ;
	}
	sum_days += day[1];
	month[1]-- ;
	while (month[1] > 0)
	{
		if (month[1] == 2)
		{
			sum_days += mon[month[1]] +((year[1] % 4 == 0 && year[1] % 100 != 0) || year[1] % 400 == 0);
		}
		else
		{
			sum_days += mon[month[1]];
		}
		month[1]-- ;
	}
	cout << sum_days << endl;
	return 0;
}
int main()
{
	int startyear,startmonth,startday,rankstartday=0;
	int endyear,endmonth,endday,rankendday=0;
	cin >> startyear >> startmonth >> startday;
	cin >> endyear >> endmonth >> endday;
	int sum=0,year=0,month;
	int days1[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int days2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	if( startyear== endyear)
	{
		if( (startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0) )
		{
			for(month=1;month<startmonth;month++)
			{
				rankstartday=rankstartday+days2[month-1];
			}
			rankstartday=rankstartday+startday;
			for(month=1;month<endmonth;month++)
			{
				rankendday=rankendday+days2[month-1];
			}
			rankendday=rankendday+endday;
		}
		if( !((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0)) )
		{
			for(month=1;month<startmonth;month++)
			{
				rankstartday=rankstartday+days1[month-1];
			}
			rankstartday=rankstartday+startday;
			for(month=1;month<endmonth;month++)
			{
				rankendday=rankendday+days1[month-1];
			}
			rankendday=rankendday+endday;
		}
		sum = rankendday - rankstartday;
	}
	if ( startyear < endyear)
	{
		if( (startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0) )
		{
			for(month=1;month<startmonth;month++)
			{
				rankstartday=rankstartday+days2[month-1];
			}
			rankstartday=rankstartday+startday;
			sum=366-rankstartday;
		}
		if( !((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0)) )
		{
			for(month=1;month<startmonth;month++)
			{
				rankstartday=rankstartday+days1[month-1];
			}
			rankstartday=rankstartday+startday;
			sum=365-rankstartday;
		}
		for(year=startyear+1;year<endyear;year++)
		{
			if( (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) )
			{
				sum=sum+366;
			}
			else sum=sum+365;
		}
		if( (endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0) )
		{
			for(month=1;month<endmonth;month++)
			{
				rankendday=rankendday+days2[month-1];
			}
			rankendday=rankendday+endday;
			sum=sum+rankendday;
		}
		if( !((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0)) )
		{
			for(month=1;month<endmonth;month++)
			{
				rankendday=rankendday+days1[month-1];
			}
			rankendday=rankendday+endday;
			sum=sum+rankendday;
		}
	}
	cout << sum << endl;
	return 0;
}
int main()
{
	int a=0,b=0,c=0,d=0,e=0,f=0,p,q,r,i,j,k,sum;
	scanf("%d%d%d\n%d%d%d",&a,&b,&c,&d,&e,&f);
	p=(d-a)*365;
	q=(b-1)*30+c;
	r=(e-1)*30+f;
	i=a;
	while (i<d)
	{
		if ((i%4==0&&i%100!=0)||(i%400==0))
		{
			p=p+1;
			i=i+1;
		}
		else
			i=i+1;
	}
	j=1;
	k=1;
	while (j<b)
	{ 
		if ((j==1)||(j==3)||(j==5)||(j==7)||(j==8)||(j==10)||(j==12))
		{
			q=q+1;
			j=j+1;
		}
		else if (j==2)
		{
			q=q-2;
			j=j+1;
		}
		else
			j=j+1;
	}
	while (k<e)
	{ 
		if ((k==1)||(k==3)||(k==5)||(k==7)||(k==8)||(k==10)||(k==12))
		{
			r=r+1;
			k=k+1;
		}
		else if (k==2)
		{
			r=r-2;
			k=k+1;
		}
		else
			k=k+1;
	}
	if (((d%4==0&&d%100!=0)||(d%400==0))&&(e>2))
		r=r+1;
	else
		r=r+0;
	sum=p-q+r;
	printf("%d",sum);
	return 0;
}
int main()
{
    int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int y1,y2,m1,m2,d1,d2;
	int i,m=0;
	scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
	if(y1<y2)
	{
		for(i=m1+1;i<=12;i++)
        {
			m=m+a[i];
		}
        m=m+a[m1]-d1;
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
		{
			if(m1<=2)
				m=m+1;
		}

        for(i=0;i<=m2-1;i++)
		{
			m=m+a[i];
		}
		m=m+d2;
		if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
		{
			if(m2>2)
				m=m+1;
		}

		for(i=y1+1;i<=y2-1;i++)
		{
			if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
                m=m+366;
			else
			    m=m+365;
        }
     
	}
    else
	{
		if(m1<m2)
		{
			for(i=m1+1;i<=m2;i++)
			{
				m=m+a[i];
			}
		    m=a[m1]-d1-(a[m2]-d2);
			if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
			{
				if(m1<=2)
					m=m+1;
			}
		}
		else
			m=d2-d1;
	}


     printf("%d",m);



		
	return 0;
}
/*
 * 1000012730_2.cpp
 *
 *  Created on: 2011-1-9
 *      Author: jsgl
 */

int judge(int y){
	if((y % 4 == 0 && y % 100 != 0)||(y % 400 == 0))
		return 1;
	else return 0;
}

int same_year(int m1,int d1,int m2,int d2,int k){
	int day=0;
	int i;
	for(i=m1;i<m2;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			day+=31;
		if(i==2)
			day+=28+k;
		if(i==4||i==6||i==9||i==11)
			day+=30;
	}
	day=day-d1+d2;
	return day;
}

int main(){
	int y1,y2,m1,m2,d1,d2;
	int i,j,k;
	int day=0;		//day???
	cin>>y1>>m1>>d1>>y2>>m2>>d2;
	if(y1==y2){
		k=judge(y1);
		day=day+same_year(m1,d1,m2,d2,k);}
	if(y1==y2-1)
	{
		k=judge(y1);
		day=day+same_year(m1,d1,12,31,k)+1;
		k=judge(y1);
		day=day+same_year(1,1,m2,d2,k);
	}
	if(y1<y2-1)
	{
		k=judge(y1);
		day=day+same_year(m1,d1,12,31,k)+1;
		k=judge(y2);
		day=day+same_year(1,1,m2,d2,k);
		for(i=y1+1;i<y2;i++)
		{
			k=judge(i);
			day+=365+k;
		}
	}
	cout<<day;
	return 0;
}
int main()
{
	int sy,sm,sd,ey,em,ed;
	int d=0;
	cin>>sy>>sm>>sd>>ey>>em>>ed;
	for(int i=sy;i<ey;i++)
		if((i%4==0&&i%100!=0)||(i%400==0))
			d=d+366;
		else
			d=d+365;
	//cout<<d;
	int p[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	for(int j=1;j<sm;j++)
		d=d-p[j];
	for(int k=1;k<em;k++)
		d=d+p[k];
	if(((ey%4==0&&ey%100!=0)||(ey%400==0))&&(em>2))
		d=d+1;
         d=d+ed-sd;
	cout<<d;
	return 0;
}
int main()
{
	int startyear,endyear,startmonth,endmonth,startday,endday,i,answer;
	long int sumdays1=0,sumdays2=0;
	scanf("%d%d%d",&startyear,&startmonth,&startday);
	scanf("%d%d%d",&endyear,&endmonth,&endday);
	for(i=1;i<startyear;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
		{
			sumdays1+=366;
		}
		else
		{
			sumdays1+=365;
		}
	}
	if((startyear%4==0&&startyear%100!=0)||(startyear%400==0))
	{
		switch(startmonth)
		{
		case 1:sumdays1+=0;
			break;
		case 2:sumdays1+=31;
			break;
		case 3:sumdays1+=60;
			break;
		case 4:sumdays1+=91;
			break;
		case 5:sumdays1+=121;
			break;
		case 6:sumdays1+=152;
			break;
		case 7:sumdays1+=182;
			break;
		case 8:sumdays1+=213;
			break;
		case 9:sumdays1+=244;
			break;
		case 10:sumdays1+=274;
			break;
		case 11:sumdays1+=305;
			break;
		case 12:sumdays1+=335;
			break;
		}
	}
	else
	{
		switch(startmonth)
		{
		case 1:sumdays1+=0;
			break;
		case 2:sumdays1+=31;
			break;
		case 3:sumdays1+=59;
			break;
		case 4:sumdays1+=90;
			break;
		case 5:sumdays1+=120;
			break;
		case 6:sumdays1+=151;
			break;
		case 7:sumdays1+=181;
			break;
		case 8:sumdays1+=212;
			break;
		case 9:sumdays1+=243;
			break;
		case 10:sumdays1+=273;
			break;
		case 11:sumdays1+=304;
			break;
		case 12:sumdays1+=334;
			break;
		}
	}
	sumdays1+=startday;
	for(i=1;i<endyear;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
		{
			sumdays2+=366;
		}
		else
		{
			sumdays2+=365;
		}
	}
	if((endyear%4==0&&endyear%100!=0)||(endyear%400==0))
	{
		switch(endmonth)
		{
		case 1:sumdays2+=0;
			break;
		case 2:sumdays2+=31;
			break;
		case 3:sumdays2+=60;
			break;
		case 4:sumdays2+=91;
			break;
		case 5:sumdays2+=121;
			break;
		case 6:sumdays2+=152;
			break;
		case 7:sumdays2+=182;
			break;
		case 8:sumdays2+=213;
			break;
		case 9:sumdays2+=244;
			break;
		case 10:sumdays2+=274;
			break;
		case 11:sumdays2+=305;
			break;
		case 12:sumdays2+=335;
			break;
		}
	}
	else
	{
		switch(endmonth)
		{
		case 1:sumdays2+=0;
			break;
		case 2:sumdays2+=31;
			break;
		case 3:sumdays2+=59;
			break;
		case 4:sumdays2+=90;
			break;
		case 5:sumdays2+=120;
			break;
		case 6:sumdays2+=151;
			break;
		case 7:sumdays2+=181;
			break;
		case 8:sumdays2+=212;
			break;
		case 9:sumdays2+=243;
			break;
		case 10:sumdays2+=273;
			break;
		case 11:sumdays2+=304;
			break;
		case 12:sumdays2+=334;
			break;
		}
	}
	sumdays2+=endday;
	answer=sumdays2-sumdays1;
	printf("%d",answer);
	return 0;
}
int main()
{
	int year1, year2, month1, month2, day1, day2, count = 0, i, dofm[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> year1 >> month1 >> day1 >> year2 >> month2 >> day2;
	count = (year2 - year1) * 365 + (year2 - year1) / 4 + (year1 % 4 - year2 % 4 > 0) - (year2 - year1) / 100 
			- (year1 % 100 - year2 % 100 > 0) + (year2 - year1) / 400 + (year1 % 400 - year2 % 400 > 0) - day1 + day2;  
	for(i = month1 - 1; i < 12; i++)
		count += dofm[i] + (judge(year1) && i == 1);
	for(i = month2 - 1; i < 12; i++)
		count -= dofm[i] + (judge(year2) && i == 1);
	cout << count;
	return 0;
}
int runnian(int y)
{
	int t;
	if(y%4==0&&y%100!=0||y%400==0)
		t=1;
	else t=0;
	return t;
}

int main()
{
	int i,y1,y2,m1,m2,d1,d2,sum=0;
	scanf("%d %d %d",&y1,&m1,&d1);
	scanf("%d %d %d",&y2,&m2,&d2);
	for(i=y1;i<y2;i++)
	{
		sum+=365+runnian(i);

	}
		for(i=1;i<m1;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(runnian(y1))
					sum-=29;
				else sum-=28;
			}
		}
		for(i=1;i<m2;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(runnian(y2))
					sum+=29;
				else sum+=28;
			}
		}
		sum=sum+d2-d1;
		printf("%d",sum);
		return 0;
}
int year1,year2,month1,month2,day1,day2;
int year[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 month[25]={0,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 main()
{
	int count_year();
	
	int count_month();
	
	int count_day();

	int judge(int a);

	scanf("%d%d%d%d%d%d",&year1,&month1,&day1,&year2,&month2,&day2);
	printf("%d\n",(count_year()+count_month()+count_day()));

	return 0;
}
int judge(int a)
{
	if ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))
		return 1;
	else 
		return 0;
}
int count_year()
{
	int i,ans=0;
	for (i=year1+1;i<year2;i++)
		ans+=365+judge(i);
	return ans;
}
int count_month()
{
	int i,ans=0;	
	if (year2>year1) 
		month2+=12;
	month[2]=year[judge(year1)][2];
	month[14]=year[judge(year2)][2];
	for (i=month1+1;i<month2;i++)
		ans+=month[i];
	return ans;
}
int count_day()
{
	if (month2>month1)
		return (year[judge(year1)][month1]-day1+day2);
	else 
		return (day2-day1);
}
int main()
{int startYear,startMonth,startDay,endYear,endMonth,endDay,n=0;
long m=0;
scanf("%d %d %d\n%d %d %d",&startYear,&startMonth,&startDay,&endYear,&endMonth,&endDay);
int i;
for (i=1;i<=startMonth;i++)
{if (i==1)n=n+0;
if (i==2)n=n+31;
if (i==3)n=n+28;
if (i==4)n=n+31;
if (i==5)n=n+30;
if (i==6)n=n+31;
if (i==7)n=n+30;
if (i==8)n=n+31;
if (i==9)n=n+31;
if (i==10)n=n+30;
if (i==11)n=n+31;
if (i==12)n=n+30;
}
if (startMonth>=3&&startMonth>=3&&startYear % 4 == 0 && startYear % 100 != 0 || startYear % 400 == 0 )
n=n+1;

n=n+startDay;

for (i=startYear;i<endYear;i++)
{if (i%4==0&&i%100!=0||i%400==0)
m=m+366;
else m=m+365;
}
int q; 
for (q=1;q<=endMonth;q++)
{if (q==1) m=m+0;
if (q==2) m=m+31;
if (q==3) m=m+28;
if (q==4) m=m+31;
if (q==5) m=m+30;
if (q==6) m=m+31;
if (q==7) m=m+30;
if (q==8) m=m+31;
if (q==9) m=m+31;
if (q==10)m=m+30;
if (q==11)m=m+31;
if (q==12) m=m+30;
}
if (endYear % 4 == 0 && endYear % 100 != 0 || endYear % 400 == 0 &&endMonth>=3)
m=m+1;


m=m+endDay;

printf("%d",m-n);
}
int main()
{
	int a[13],n,i,m;
	int year1,year2,month1,month2,day1,day2;
	scanf("%d %d %d\n",&year1,&month1,&day1);
	scanf("%d %d %d",&year2,&month2,&day2);
	a[0]=0;a[1]=1;a[2]=-2;a[3]=1;a[4]=0;
	a[5]=1;a[6]=0;a[7]=1;a[8]=1;a[9]=0;
	a[10]=1;a[11]=0;a[12]=1;
	m=0;n=0;
		if(year1==year2)
		{
			if(month1==month2)
			{
				n=day2-day1;
			}
			else 
			{
				for(i=month1;i<month2;i++)
				{
					m=m+a[i];
					if(year1%4==0&&year1%100!=0||year1%400==0)
						m=m+1;
					n=(month2-month1-1)*30+day2+30-day1+m;
				}
			}
		}
		else
		{
			m=30+a[month1]-day1;
			for(i=month1+1;i<=12;i++)
			{	m=m+30+a[i];}
			m=m+day2;
			for(i=1;i<month2;i++)
			{   m=m+30+a[i];}
			if((year1%4==0&&year1%100!=0||year1%400==0)&&month1<=2)
				m=m+1;
			if((year2%4==0&&year2%100!=0||year2%400==0)&&month2>2)
				m=m+1;
			for(i=year1+1;i<year2;i++)
			{
				if(i%4==0&&i%100!=0||i%400==0)
				{
					n=n+366;
				}
				else
					n=n+365;

			}
			n=n+m;
		}
		printf("%d\n",n);
		return 0;
}
int main()
{
	int a[2][3];
	int day=0,flag=0,i,j,sum=0,k;

	scanf("%d%d%d%d%d%d",&a[0][0],&a[0][1],&a[0][2],&a[1][0],&a[1][1],&a[1][2]);
	if(a[0][0]-a[1][0]==0)
	{
		for(j=a[0][1];j<a[1][1];j++)
		{
			if(a[0][0]%4==0&&a[0][0]%100!=0&&j==2||a[0][0]%400==0&&j==2)
			{
				day+=29;
			}
			else if(j==2)
			{
				day+=28;
			}
			else if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			{
				day+=31;
			}
			else
			{
				day+=30;
			}
		}
		sum=day-a[0][2]+a[1][2];
	}
	else
	{
		for(i=a[0][0]+1;i<a[1][0];i++)
		{
			if(i%4==0&&i%100!=0||i%400==0)
			{
				flag+=1;
			}
		}
		for(j=a[0][1];j<=12;j++)
		{
			if(a[0][0]%4==0&&a[0][0]%100!=0&&j==2||a[0][0]%400==0&&j==2)
			{
				day+=29;
			}
			else if(j==2)
			{
				day+=28;
			}
			else if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			{
				day+=31;
			}
			else
			{
				day+=30;
			}
		}
		sum=day-a[0][2];
		day=0;
		for(k=1;k<a[1][1];k++)
		{
			if(a[1][0]%4==0&&a[1][0]%100!=0&&k==2||a[1][0]%400==0&&k==2)
			{
				day+=29;
			}
			else if(k==2)
			{
				day+=28;
			}
			else if(k==1||k==3||k==5||k==7||k==8||k==10||k==12)
			{
				day+=31;
			}
			else
			{
				day+=30;
			}
		}
		sum=sum+day+a[1][2];
		sum=sum+365*a[1][0]-365*a[0][0]-365+flag;
	}
	printf("%d",sum);
	return 0;
}
/*
 * y3.cpp
 *
 *  Created on: 2011-1-9
 *      Author: jsgl
 */
int main(){
	int starty,startm,startd,
	    endy,endm,endd,run=0,t1=0,t2=0,total=0,i,
	month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>starty>>startm>>startd;
	cin>>endy>>endm>>endd;
	for(i=starty+1;i<endy;i++)
		if((i%4 == 0 && i% 100 != 0) || (i % 400 == 0))
			run++;
	if(((starty%4 == 0&&starty% 100 != 0)||(starty % 400 == 0))&&startm<=2)
	   run++;
	if(((endy%4 == 0&&endy% 100 != 0)||(endy % 400 == 0))&&endm>=3)
	   run++;
	total=365*(endy-starty);
	for(i=0;i<startm-1;i++)
		t1+=month[i];
	for(i=0;i<endm-1;i++)
		t2+=month[i];
	t1+=startd;
	t2+=endd;
	total=total+t2-t1+run;
	cout<<total;
	return 0;
}
int main()
{
	int startYear, startMonth, startDay, endYear, endMonth, endDay, month1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, month2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, count = 0, i, j;
	cin >> startYear >> startMonth >> startDay >> endYear >> endMonth >> endDay;
	if (startYear == endYear)
	{
		if (((startYear % 4 == 0) && startYear % 100 != 0) || (startYear % 400 == 0))
		{
			if (startMonth == endMonth)
			{
				count = endDay - startDay;
			}
			else
			{
				for (i = startMonth + 1; i <= endMonth; i++)
				{
					count += month2[i];
				}
				count += month2[startMonth] - startDay;
				count += endDay;
			}
		}
		else
		{
			if (startMonth == endMonth)
			{
				count = endDay - startDay;
			}
			else
			{
				for (i = startMonth + 1; i <= endMonth; i++)
				{
					count += month1[i];
				}
				count += month1[startMonth] - startDay;
				count += endDay;
			}
		}
	}
	else
	{
		for (j = startYear; j <= endYear; j++)
		{
			if (j == startYear)
			{
				if (((j % 4 == 0) && j % 100 != 0) || (j % 400 == 0))
				{
					for (i = startMonth + 1; i <= 12; i++)
						count += month2[i];
					count += month2[startMonth] - startDay;
				}
				else
				{
					for (i = startMonth + 1; i <= 12; i++)
						count += month1[i];
					count += month1[startMonth] - startDay;
				}
			}
			else if (j == endYear)
			{
				if (((j % 4 == 0) && j % 100 != 0) || (j % 400 == 0))
				{
					for (i = 1; i <= endMonth - 1; i++)
						count += month2[i];
					count += endDay;
				}
				else
				{
					for (i = 1; i <= endMonth - 1; i++)
						count += month1[i];
					count += endDay;
				}
			}
			else
			{
				if (((j % 4 == 0) && j % 100 != 0) || (j % 400 == 0))
				{
					count += 366;
				}
				else
				{
					count += 365;
				}
			}
		}
	}
	cout << count;
	return 0;
}
int main()
{
	int year1, month1, day1;
	int year2, month2, day2;
	int total=0;
	
	scanf("%d%d%d%d%d%d",&year1,&month1,&day1,&year2,&month2,&day2);
	
	for (; ; ) {
		if (year1 == year2 && month1 == month2 && day1 == day2) {
			break;
		}
		else {
			if (day1 == 31) {
				if (month1 == 1 || month1 == 3 || month1 == 5 || month1 == 7 || month1 == 8 || month1 == 10) {
					month1 ++;
					day1 = 0;
				}
				else if (month1 == 12) {
					day1 = 0;
					month1 = 1;
					year1 ++;
				}
			}
			else if(day1 == 30){
				if(month1 == 4 || month1 == 6 || month1 == 9 || month1 == 11) {
					month1 ++;
					day1 = 0;
				}
			}
			else if(day1 == 28) {
				if (month1 == 2) {
					if ((year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0)) {
						day1 = 0;
						month1 ++;
						total ++;
					}
					else {
						day1 = 0;
						month1 ++;
					}
				}
			}
		}
		total ++;
		day1 ++;
	}
	printf("%d",total);
	return 0;
}
int main()
{
int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int y1,m1,d1,y2,m2,d2,i,j,c1,c2,year,n,run,h,sum;
year=365;
scanf("%d%d%d\n%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
if(y2>y1)
{
if((y1% 4 == 0 && y1% 100 != 0) || (y1% 400 == 0))
{
days[2]++;
year++;
}
c1=d1;
for(i=1;i<m1;i++)
c1+=days[i];
c1=year-c1;
days[2]=28;
if((y2% 4 == 0 && y2% 100 != 0) || (y2% 400 == 0))
days[2]++;
c2=d2;
for(j=1;j<m2;j++)
c2+=days[j];
n=y2-y1-1;
run=0;
for(h=y1+1;h<=y2-1;h++)
{
if((h% 4 == 0 && h% 100 != 0) || (h% 400 == 0))
run++;
}
n=n-run;
sum=c1+c2+n*365+run*366;
}
if(y2==y1)
{
if((y1% 4 == 0 && y1% 100 != 0) || (y1% 400 == 0))
{
days[2]++;

}
c1=d1;
for(i=1;i<m1;i++)
c1+=days[i];
days[2]=28;
if((y2% 4 == 0 && y2% 100 != 0) || (y2% 400 == 0))
days[2]++;
c2=d2;
for(j=1;j<m2;j++)
c2+=days[j];
sum=c2-c1;
}
printf("%d",sum);

return 0;
}
int main()
{
    int a,b,c,d,e,f,x,y,z,n;
    x=0;
    y=0;
    z=0;
    scanf("%d %d %d\n%d %d %d",&a,&b,&c,&d,&e,&f);
    
    for(;a<d;)
    {
              if((a%4==0&&a%100!=0)||(a%400==0))
              x=x+366;
              else
              x=x+365;
              a++;
    }
    
    if(b<=e)
    {
              for(;b<e;)
              {
                           switch(b)
                           {
                                     case 1:y=y+31;break;
                                     case 3:y=y+31;break;
                                     case 5:y=y+31;break;
                                     case 7:y=y+31;break;
                                     case 8:y=y+31;break;
                                     case 10:y=y+31;break;
                                     case 12:y=y+31;break;
                                     case 4:y=y+30;break;
                                     case 6:y=y+30;break;
                                     case 9:y=y+30;break;
                                     case 11:y=y+30;break;
                                     default:if((d%4==0&&d%100!=0)||(d%400==0))
                                             
                                                                                 y=y+29;
                                                                                 
                                             
                                             else
                                                 y=y+28;
                                                 
                           }
                           b++;
              }
    }
    else
    {         
              for(;e<b;)
              {
                           switch(e)
                           {
                                     case 1:y=y-31;break;
                                     case 3:y=y-31;break;
                                     case 5:y=y-31;break;
                                     case 7:y=y-31;break;
                                     case 8:y=y-31;break;
                                     case 10:y=y-31;break;
                                     case 12:y=y-31;break;
                                     case 4:y=y-30;break;
                                     case 6:y=y-30;break;
                                     case 9:y=y-30;break;
                                     case 11:y=y-30;break;
                                     default:if((d%4==0&&d%100!=0)||(d%400==0))
                                             
                                                                                 y=y-29;
                                                                                 
                                             
                                             else
                                                 y=y-28;
                                                 
                           }
                           e++;
              }
    }     

    
    z=f-c;
    n=x+y+z;
    printf("%d\n",n);
        return 0;
}
int main()
{
	int year[2],month[2],day[2],i,s=0,j;
	scanf("%d %d %d",&year[0],&month[0],&day[0]);
	scanf("%d %d %d",&year[1],&month[1],&day[1]);
	if(year[1]-year[0]!=0)
	{for(i=year[0];i<=year[1];i++)
	{
		if(i==year[0])
		{
			for(j=month[0];j<=12;j++)
			{
				if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
				{
					s=s+31;
				}
				else if(j==2)
				{
					if((i%4==0&i%100!=0)||i%400==0)
					s=s+29;
					else
					s=s+28;
				}
				else 
				{
					s=s+30;
				}
			}
		}
		if(i>year[0]&&i<year[1])
		{
			if((i%4==0&i%100!=0)||i%400==0)
			s=s+366;
			else
			s=s+365;
		}
		if(i==year[1])
		{
			for(j=1;j<month[1];j++)
			{
				if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
				{
					s=s+31;
				}
				else if(j==2)
				{
					if((i%4==0&i%100!=0)||i%400==0)
					s=s+29;
					else
					s=s+28;
				}
				else 
				{
					s=s+30;
				}
			}
		}
	}
	}
	else
	{
		for(j=month[0];j<month[1];j++)
		{
			if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
				{
					s=s+31;
				}
				else if(j==2)
				{
					if((year[0]%4==0&i%100!=0)||year[0]%400==0)
					s=s+29;
					else
					s=s+28;
				}
				else 
				{
					s=s+30;
				}
		}
	}
	s=s-day[0]+day[1];
	printf("%d",s);
	return 0;
}
int main(){
	int a,b,c,d,e,f,n1=0,n2=0,i;
	cin>>a>>b>>c>>d>>e>>f;
	int t[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};//??????
	for(i=1;i<=a-1;i++)
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))//???366,??+365
			n1=n1+366;
		else n1=n1+365;
	for(i=1;i<=d-1;i++)
			if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
				n2=n2+366;
			else n2=n2+365;
	for(i=1;i<=b-1;i++)
		n1=n1+t[i];
	for(i=1;i<=e-1;i++)
		n2=n2+t[i];
	if(((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0))&&(b>2))//????+1
		n1++;
	if(((d % 4 == 0 && d % 100 != 0) || (d % 400 == 0))&&(e>2))
        n2++;
	cout<<n2+f-n1-c<<endl;
	return 0;
}