semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a[2][3];
	int i,j,n,k;
	n=0;
	for(i=0;i<2;i++)
	{
		for(j=0;j<3;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	if(a[0][0]!=a[1][0])
	{
	for(i=a[0][0];i<=a[1][0];i++)
	{
		if(i==a[0][0])
		{
			for(j=a[0][1];j<=12;j++)
			{
				if(j==a[0][1])
				{
					if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
						n+=31-a[0][2];
					else if(j==2)
					{
						if(i%4==0&&i%100!=0||i%400==0)
							n+=29-a[0][2];
						else
							n+=28-a[0][2];
					}
					else
						n+=30-a[0][2];
				}
				else
				{
					if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
						n+=31;
					else if(j==2)
					{
						if(i%4==0&&i%100!=0||i%400==0)
						n+=29;
						else
							n+=28;
					}
					else
						n+=30;
				}
			}
		}
		else if(i==a[1][0])
		{
			if(i%4==0&&i%100!=0||i%400==0)
					n+=366;
				else
					n+=365;
			for(j=12;j>=a[1][1];j--)
			{
				if(j!=a[1][1])
				{
					if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
						n-=31;
					else if(j==2)
					{
						if(i%4==0&&i%100!=0||i%400==0)
							n-=29;
						else
							n-=28;
					}
					else
						n-=30;
				}
				else
				if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
						n-=31-a[1][2];
					else if(j==2)
					{
						if(i%4==0&&i%100!=0||i%400==0)
							n=n-29+a[1][2];
						else
							n=n-28+a[1][2];
					}
					else
						n=n-30+a[1][2];
			}
		}
		else
		{
			if(i%4==0&&i%100!=0||i%400==0)
				n+=366;
			else
				n+=365;
		}
	}
	}
	else if(a[0][1]==a[1][1])
		n+=(a[1][2]-a[0][2]);
	else
		for(j=a[0][1];j<=a[1][1];j++)
		{
			if(j==a[0][1])
			{
				if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
						n+=31-a[0][2];
					else if(j==2)
					{
						if(i%4==0&&i%100!=0||i%400==0)
							n+=29-a[0][2];
						else
							n+=28-a[0][2];
					}
					else
						n+=30-a[0][2];
			}
			else if(j==a[1][1])
				n+=a[1][2];
			else
				{
				if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
						n+=31;
					else if(j==2)
					{
						if(i%4==0&&i%100!=0||i%400==0)
							n+=29;
						else
							n+=28;
					}
					else
						n+=30;
			}
		}
	printf("\n%d",n);
	return 0;
}
int main()
{
	int sum1, sum2, month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int year1, year2, month1, month2, day1, day2;
	int i, count = 0;
	cin >> year1 >> month1 >> day1;
	cin >> year2 >> month2 >> day2;
	for(i = 1; i < year1; i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			count++;
	}
	sum1 = 365 * (year1 - 1) + day1 + count;
	for(i = 1; i < month1; i++)
		sum1 += month[i];
	if((year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0))
	{
		if(month1 > 2)
			sum1++;
	}
	count = 0;
	for(i = 1; i < year2; i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			count++;
	}
	sum2 = 365 * (year2 - 1) + day2 + count;
	for(i = 1; i < month2; i++)
		sum2 += month[i];
	if((year2 % 4 == 0 && year2 % 100 != 0) || (year2 % 400 == 0))
	{
		if(month2 > 2)
			sum2++;
	}
	cout << sum2 - sum1 << endl;
	return 0;
}
int main()
{
	int startyear, startmonth, startday, endyear, endmonth, endday, year, sum = 0, i;
	int m1[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, m2[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> startyear >> startmonth >> startday >> endyear >> endmonth >> endday;
	year = startyear;
	while(year < endyear)
	{
		if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
			sum += 366;
		else
			sum += 365;
		year++;
	}
	if ((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0))
	{
		for (i = 1; i < startmonth; i++)
			sum -= m2[i];
		sum -= startday;
	}
	else
	{
		for (i = 1; i < startmonth; i++)
			sum -= m1[i];
		sum -= startday;
	}
	if ((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0))
	{
		for (i = 1; i < endmonth; i++)
			sum += m2[i];
		sum += endday;
	}
	else
	{
		for (i = 1; i < endmonth; i++)
			sum += m1[i];
		sum += endday;
	}
	cout << sum << endl;
	return 0;
}
int run(int year);
int main()
{
	int sy,sm,sd,ey,em,ed,i,sum=0;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>sy>>sm>>sd;
	cin>>ey>>em>>ed;
	for(i=sy;i<ey;i++)
	{
		if(run(i)==1)
			sum+=366;
		else
			sum+=365;
	}
	for(i=1;i<sm;i++)
	{
		sum-=m[i];
		if(i==2&&run(sy)==1)
			sum--;
	}
	sum-=sd;
	for(i=1;i<em;i++)
	{
		sum+=m[i];
		if(i==2&&run(ey)==1)
			sum++;
	}
	sum+=ed;
	cout<<sum<<endl;
	return 0;
}
int run(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	return 0;
}
int main(int argc, char *argv[])
{
  int a[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
  int b[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  int count1=0,count2=0,year1,year2,month1,month2,date1,date2,i,sum=0;
  scanf("%d %d %d%d %d %d",&year1,&month1,&date1,&year2,&month2,&date2);
  for (i=1;i<=month1;i++)
  {
      if ((year1%4==0)&&(year1%100!=0)||(year1%400==0))
      count1+=a[i-1];
      else
      count1+=b[i-1];
  }
  count1+=date1;
  for (i=1;i<=month2;i++)
  {
      if ((year2%4==0)&&(year2%100!=0)||(year2%400==0))
      count2+=a[i-1];
      else
      count2+=b[i-1];
  }
  count2+=date2;
  if (year1==year2)
  sum=0;
  else
  for (i=year1;i<=year2-1;i++)
  {
      if ((i%4==0)&&(i%100!=0)||(i%400)==0)
      sum+=366;
      else
      sum+=365;
  }
  printf("%d",sum-count1+count2);	
  return 0;
}
int days(int x,int y,int z)
{
    int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int i,d=0;
    for(i=1;i<=(x-1);i++) 
    {
           if((i%4==0&&i%100!=0)||(i%400==0)) d=d+366;
           else d=d+365;
    }
    if(y==1) d=d+z;
    else if(y==2) d=d+31+z;
    else if(y>2)
    {
           for(i=1;i<=y-1;i++) {d=d+a[i];}
           if((x%4==0&&x%100!=0)||(x%400==0)) d=d+1+z;
           else d=d+z;
    }
    return(d);
}

main()
{
    int sy,sm,sd,ey,em,ed;
    int days(int x,int y,int z);
    int a,b;
    scanf("%d %d %d %d %d %d",&sy,&sm,&sd,&ey,&em,&ed);
    a=days(sy,sm,sd);
    b=days(ey,em,ed);
    printf("%d",b-a);
}
int mon[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 f(int y, int m, int d)
{
	int i, day = 0;
	for (i = 1; i < y; i++)
	{
		if ((i % 400 == 0) || ((i % 100 != 0) && (i % 4 == 0)))
		{
			day = day + 366;
		}
		else
			day = day + 365;
	}
	int temp = ((y % 400 == 0) || ((y % 100 != 0) && (y % 4 == 0)));
	for (i = 1; i < m; i++)
	{
		day = day + mon[temp][i];
	}
	day = day + d;
	return day;
}

int main()
{
	int y1, m1, d1, y2, m2, d2, day1, day2;
	cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
	day1 = f(y1, m1, d1);
	day2 = f(y2, m2, d2);
	if (day1 >= day2)
		cout << day1 - day2 << endl;
	else
		cout << day2 - day1 << endl;
	return 0;
}
int year(int y)
{
	int a;
	if((y%4==0&&y%100!=0)||(y%400==0)) a=366;
	else a=365;
	return(a);
}
int month(int m)
{
	int d;
	switch(m)
	{
	case 1:d=31;break;
    case 2:d=28;break;
    case 3:d=31;break;
    case 4:d=30;break;
    case 5:d=31;break;
    case 6:d=30;break;
    case 7:d=31;break;
    case 8:d=31;break;
    case 9:d=30;break;
    case 10:d=31;break;
    case 11:d=30;break;
    case 12:d=31;break;
	}
	return(d);
}
void main()
{
	int y1,y2,m1,m2,d1,d2,i,ds=0;
	scanf("%d%d%d",&y1,&m1,&d1);
	scanf("%d%d%d",&y2,&m2,&d2);
	for(i=y1;i<y2;i++) ds=ds+year(i);
	for(i=1;i<m1;i++) ds=ds-month(i);
	for(i=1;i<m2;i++) ds=ds+month(i);
	ds=ds+d2-d1;
	if(y1==y2&&year(y1)==366)
	{
		if(m2>2&&m1<3) ds=ds+1;
	}
	if(y1!=y2)
	{
		if(year(y1)==366&&m1>2) ds=ds-1;
	    if(year(y2)==366&&m2>2) ds=ds+1;
	}
	printf("%d\n",ds);
}
/*
 *????? ???????????.cpp
 *??	    ???
 *????: 2011-11-4
 *????????????????????.
 */


int main()
{
	int year1,year2,month1,month2,date1,date2,Day=0,Day1=0,Day2=0,i,numr=0,nump;//?????year1,year2,month1,month2,date1,date2????????Day????????Day??????????????Day2??????????????numr,nump??????????????
	int Monthr[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};                     //????Monthr????????
	int Monthp[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};                     //????Monthp????????
	cin>>year1>>month1>>date1; 
	cin>>year2>>month2>>date2;
	if((year1%4==0&&year1%100!=0)||(year1%400==0))                              //???year1???????????????????????
	{
		for(i=1;i<=month1;i++)
			Day1=Monthr[i]+Day1;
		Day1=Day1-(Monthr[month1]-date1)-1;
	}
	else
	{
		for(i=1;i<=month1;i++)
					Day1=Monthp[i]+Day1;
				Day1=Day1-(Monthp[month1]-date1)-1;
	}

	if((year2%4==0&&year2%100!=0)||(year2%400==0))                             //???year2???????????????????????
		{
			for(i=12;i>=month2;i--)
				Day2=Monthr[i]+Day2;
			Day2=Day2-date2;
		}
		else
		{
			for(i=12;i>=month2;i--)
						Day2=Monthp[i]+Day2;
					Day2=Day2-date2;
		}
for(i=year1;i<=year2;i++)                                                        //?????????????
{
	if((i%4==0&&i%100!=0)||(i%400==0))
		numr++;
}
	nump=year2-year1+1-numr;                                                   //??????????????  
	Day=365*nump+366*numr-Day1-Day2-1;                                         //?????????????????????????????
	cout<<Day<<endl;
	return 0;
}
void main()
{
	int year1,year2,month1,month2,day1,day2,a,b,c,d,tempyear,tempmonth,tempday;
	d = 0;
	scanf("%d %d %d",&year1,&month1,&day1);
	scanf("%d %d %d",&year2,&month2,&day2);
	int montha[12]={0,31,60,91,121,152,182,213,244,274,305,335};
	int monthb[12]={0,31,59,90,120,151,181,212,243,273,304,334};
    if(year1==year2)
	{
		if (month1 == month2)
		{
			printf("%d",day2-day1);
		}
		else
		{
			if ((year1%4==0)&&(year1%100!=0)||(year1%400==0))
				printf("%d",montha[month2-1]-montha[month1-1]+day2-day1);
			else
				printf("%d",monthb[month2-1]-monthb[month1-1]+day2-day1);
		}
	}
	else
	{
		a = year1+1;
		b = year2;
		c = 0;
		while(a<b)
		{
			if ((a%4==0)&&(a%100!=0)||(a%400==0))
				c+=366;
			else
				c+=365;
			a++;
		}

		if (year1 > year2)
		{
			d = 1;

			tempyear=year1;
			year1=year2;
			year2=tempyear;

			tempmonth=month1;
			month1=month2;
			month2=tempmonth;

			tempday=day1;
			day1=day2;
			day2=tempday;
		}
		if ((year1%4==0)&&(year1%100!=0)||(year1%400==0))
			c+=366-(montha[month1-1]+day1);
		else
			c+=365-(monthb[month1-1]+day1);

		if ((year2%4==0)&&(year2%100!=0)||(year2%400==0))
			c+=(montha[month2-1]+day2);
		else
			c+=(monthb[month2-1]+day2);

		if (d == 0) printf("%d",c);
		else printf("%d",0-c);
	}
}
int main()
{
	int y,m,d,y2,m2,d2,max,t=0;
	int day[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d%d%d",&y,&m,&d);
	scanf("%d%d%d",&y2,&m2,&d2);
	max=day[m];
	if(m==2 && ((y%4==0 && y%100!=0) ||(y%100==0 && y%400==0))) max++;
	while(y<y2 || m<m2 || d<d2)
	{
		t++;
		d++;
		if(d>max)
		{
			d=1;
			m++;
		}
		if(m>12)
		{
			m=1;
			y++;
		}
		max=day[m];
	    if(m==2 && ((y%4==0 && y%100!=0) ||(y%100==0 && y%400==0))) max++;
	}
	printf("%d",t);
	return 0;
}
int main ()
{
	int syear, smonth, sday,eyear, emonth,eday;
	int leap[3001]={0},i;
	int days=0;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin >> syear >> smonth >> sday ;
	cin >> eyear >> emonth >> eday ;
	for (i=1; i<=3000; i++ )//??????
		leap[i]= (( (i % 4==0) && (i % 100!=0)) || i % 400==0);
	days = days+(eyear-syear)*365;
	for ( i=syear; i<= eyear; i++ )
		days = days+ leap[i]; 
	for ( i=1; i<= emonth-1; i++ )
		days = days + m[i];
	for ( i=1; i<= smonth - 1; i++ )
		days = days - m[i];
	if ( leap [ syear ] == 1 && smonth > 2 )
		days = days -1;
	if ( leap [eyear ] ==1 && emonth <= 2 )
		days = days -1;
	days = days + eday - sday ;
	cout << days << endl; 
	return 0;
}
int b[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int c[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};

int calender(int y,int m,int d)
{
	int date=0;
	int y1=1;
	while(y1<y)
	{
		if(((y1) % 4 == 0 && (y1) % 100 != 0) || ((y1) % 400 == 0))
		{
			date=date+366;
			y1++;
		}
		else
		{
			date=date+365;
			y1++;
		}
	}
	while(m>1)
	{
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1% 400 == 0))
		{
			date=date+c[m-1];
			m--;
		}
		else
		{
			date=date+b[m-1];
			m--;
		}
	}
	date=date+d-1;
	return date;

}


int main()
{
	int y1,m1,d1;
	int y2,m2,d2;
	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	cout<<calender(y2,m2,d2)-calender(y1,m1,d1);
	return 0;
}
int RunNian(int year)
{
	if(((year%4==0)&&(year%100!=0))||(year%400==0))
		return 1;
	else
		return 0;
}
int Dijitian(int year,int month,int day)
{
	int total=0,i;
	for(i=1;i<month;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			total+=31;
		if(i==4||i==6||i==9||i==11)
			total+=30;
		if(i==2)
		{
			if(RunNian(year)) total+=29;
			else total+=28;
		}
	}
	total+=day;
	return total;
}
int main()
{
	int startYear,startMonth,startDay,endYear,endMonth,endDay;
	scanf("%d %d %d",&startYear,&startMonth,&startDay);
    scanf("%d %d %d",&endYear,&endMonth,&endDay);
	int num=0;
	if(startYear==endYear)
		num=Dijitian(endYear,endMonth,endDay)-Dijitian(startYear,startMonth,startDay);
	else
	{
		int i;
		for(i=startYear;i<endYear;i++)
		{
			if(RunNian(i))
				num+=366;
			else
				num+=365;
		}
		num+=Dijitian(endYear,endMonth,endDay)-Dijitian(startYear,startMonth,startDay);
	}
	printf("%d\n",num);
	return 0;
}
main()
{
	int sum=0;
	int m,n;
	int y1,m1,d1,y2,m2,d2;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d %d %d",&y1,&m1,&d1);
	scanf("%d %d %d",&y2,&m2,&d2);
	if(y1!=y2)
	{
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
		{
			a[2]=29;
			m=d1;
			for(int i=1;i<m1;i++)
			{
				m+=a[i];
			}
			sum+=366-m;
		}
		else
		{
			a[2]=28;
			m=d1;
			for(int i=1;i<m1;i++)
			{
				m+=a[i];
			}
			sum+=365-m;
		}
		y1++;
		if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0))
		{
			a[2]=29;
			m=d2;
			for(int i=1;i<m2;i++)
			{
				m+=a[i];
			}
			sum+=m;
		}
		else
		{
			a[2]=28;
			m=d2;
			for(int i=1;i<m2;i++)
			{
				m+=a[i];
			}
			sum+=m;
		}
	}
	else
	{
		if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0))
		{
			a[2]=29;
			m=d1;
			for(int i=1;i<m1;i++)
			{
				m+=a[i];
			}
			n=d2;
			for(int i=1;i<m2;i++)
			{
				n+=a[i];
			}
			sum=n-m;
		}
		else
		{
			a[2]=28;
			m=d1;
			for(int i=1;i<m1;i++)
			{
				m+=a[i];
			}
			n=d2;
			for(int i=1;i<m2;i++)
			{
				n+=a[i];
			}
			sum=n-m;
		}
	}
	for(;y1<y2;y1++)
	{
		if(((y1%4)==0&&(y1%100)!=0)||((y1%400)==0))
		{
			sum+=366;
		}
		else
		{
			sum+=365;
		}
	}
	printf("%d\n",sum);
}
int main()
{
	int a[3],b[3],i,j,k,n=0,d=0,m=0,s=0;
	scanf("%d%d%d",&a[0],&a[1],&a[2]);
	scanf("%d%d%d",&b[0],&b[1],&b[2]);
    for(i=a[0];i<=b[0];i++)
	{
        if(i%4==0&&i%100!=0||i%400==0)
			n=n+366;
		else
			n=n+365;
	}
	for(j=0;j<a[1];j++)
	{
		if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
			d=d+31;
		if(j==4||j==6||j==9||j==11)
			d=d+30;
		if(j==2&&(a[0]%4==0&&a[0]%100!=0||a[0]%400==0))
			d=d+29;
		if(j==2&&(a[0]%4!=0||a[0]%100==0&&a[0]%400!=0))
			d=d+28;
	}
    for(k=12;k>=b[1];k--)
	{
		if(k==1||k==3||k==5||k==7||k==8||k==10||k==12)
			m=m+31;
		if(k==4||k==6||k==9||k==11)
			m=m+30;
		if(k==2&&(b[0]%4==0&&b[0]%100!=0||b[0]%400==0))
			m=m+29;
		if(k==2&&(b[0]%4!=0||b[0]%100==0&&b[0]%400!=0))
			m=m+28;
	}
	s=n-d-m+b[2]-a[2];
	printf("%d",s);
	return 0;
}
void main()
{
	int sy,sm,sd,ey,em,ed,i=0,j=0,m=0;
	long int n;
	scanf("%d %d %d\n%d %d %d",&sy,&sm,&sd,&ey,&em,&ed);
	n=-sd+ed;
	while(i<=sm-1){
	   switch(i){
	    case 0:n=n;break;
		case 1:n=n-31;break;
		case 2:n=n-30;break;
	    case 3:n=n-31;break;
		case 4:n=n-30;break;
		case 5:n=n-31;break;
		case 6:n=n-30;break;
		case 7:n=n-31;break;
		case 8:n=n-31;break;
        case 9:n=n-30;break;
		case 10:n=n-31;break;
		case 11:n=n-30;break;
	   }
	
		i=i+1;
	}
	if(((sy%4==0&&sy%100!=0)||(sy%400==0))&&sm>=3){
		n=n+1;
	}
	while(j<=em-1){
		switch(j){
		case 0:n=n;break;
		case 1:n=n+31;break;
		case 2:n=n+30;break;
	    case 3:n=n+31;break;
		case 4:n=n+30;break;
		case 5:n=n+31;break;
        case 6:n=n+30;break;
		case 7:n=n+31;break;
		case 8:n=n+31;break;
        case 9:n=n+30;break;
		case 10:n=n+31;break;
		case 11:n=n+30;break;
	   }
	
		j=j+1;
	}
	if(((ey%4==0&&ey%100!=0)||(ey%400==0))&&em>=3){
		n=n-1;
	}
	while(m+sy<=ey-1){
		if(((m+sy)%4==0&&(m+sy)%100!=0)||((m+sy)%400==0)){
			n=n+366;
		}
		else{
			n=n+365;
		}
		m=m+1;
	}
	printf("%ld\n",n);
}
int main()
{
	int sy,sm,sd,ey,em,ed,i,x;
	scanf("%d %d %d\n",&sy,&sm,&sd);
	scanf("%d %d %d",&ey,&em,&ed);
	x=(ey-sy+1)*365-(sm-1)*31-(12-em+1)*31+ed-sd;

	for(i=sy;i<=ey;i++)
	{if(i%4==0&&i%100!=0||i%400==0)x=x+1;}  

	for(i=1;i<sm;i++)
	{if(i==4||i==6||i==9||i==11)x=x+1;
	else if(i==2)
	
	{if(sy%4==0&&i%100!=0||i%400==0)x=x+2;
	else x=x+3;}}

	for(i=em;i<13;i++)
	{if(i==4||i==6||i==9||i==11)x=x+1;
	else if(i==2)
	{if(ey%4==0&&ey%100!=0||ey%400==0)x=x+2;
	else x=x+3;}}
	printf("%d",x);
}
/*
 * 3.cpp
 *
 *  Created on: 2011-1-9
 *      Author: jsgl
 */


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 numr=0;
	int i;
	cin>>y1>>m1>>d1;
	cin>>y2>>m2>>d2;
	for(i=y1;i<y2;i++)
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			numr++;
	if((((y1%4==0&&y1%100!=0)||(y1%400==0))&&m1>2))
		numr--;
	int yd1=0,yd2=0;
	if((y2%4==0&&y2%100!=0)||(y2%400==0))
		month[1]++;
	for(i=0;i<m1-1;i++)
		yd1+=month[i];
	yd1+=d1;
	for(i=0;i<m2-1;i++)
		yd2+=month[i];
	yd2+=d2;
	cout<<365*(y2-y1)+numr+yd2-yd1<<endl;
	return 0;
}
int main(void){
   int year1,month1,day1,j,a,k;
   int year2,month2,day2,l,n,b,m;
   int sum1,sum2;
   int result;
   
   scanf("%d %d %d",&year1,&month1,&day1);
   
   scanf("%d %d %d",&year2,&month2,&day2);
   j=(year1-1)/4-(year1-1)/100+(year1-1)/400;
   if((year1%4==0&&year1%100!=0)||(year1%400==0))
   a=1;
   else
   a=0;
if(month1==1)
   k=0;
else if(month1==2)
   k=31;
else if(month1==3)
   k=59+a;
else if(month1==4)
   k=90+a;
else if(month1==5)
   k=120+a;
else if(month1==6)
   k=151+a;
else if(month1==7)
   k=181+a;
else if(month1==8)
   k=212+a;
else if(month1==9)
   k=243+a;
else if(month1==10)
   k=273+a;
else if(month1==11)
   k=304+a;
else 
   k=334+a;
sum1=year1*365+k+day1+j;
   n=(year2-1)/4-(year2-1)/100+(year2-1)/400;
   {if((year2%4==0&&year2%100!=0)||(year2%400==0))
   b=1;
   else
   b=0;
if(month2==1)
   m=0;
else if(month2==2)
   m=31;
else if(month2==3)
   m=59+b;
else if(month2==4)
   m=90+b;
else if(month2==5)
   m=120+b;
else if(month2==6)
   m=151+b;
else if(month2==7)
   m=181+b;
else if(month2==8)
   m=212+b;
else if(month2==9)
   m=243+b;
else if(month2==10)
   m=273+b;
else if(month2==11)
   m=304+b;
else 
   m=334+b;
sum2=year2*365+m+day2+n;}
    result=fabs(sum1-sum2);
    printf("%d",result);
}
int main()
{
	int M[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int y1, m1, d1, y2, m2, d2;
	int r1, r2;
	scanf("%d%d%d%d%d%d", &y1, &m1, &d1, &y2, &m2, &d2);
	r1 = 0;
	for(int year = 1; year < y1; year ++) {
		if((year % 4 == 0 && year % 100 != 0) || (year % 400) == 0) { r1 += 366; }
		else { r1 += 365; }
	}
	for(int month = 1; month < m1; month ++) {
		r1 += M[month];
	}
	r1 += d1 - 1;
	if((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400) == 0) {
		if(m1 > 2) { r1 ++; }
	}
	r2 = 0;
	for(int year = 1; year < y2; year ++) {
		if((year % 4 == 0 && year % 100 != 0) || (year % 400) == 0) { r2 += 366; }
		else { r2 += 365; }
	}
	for(int month = 1; month < m2; month ++) {
		r2 += M[month];
	}
	r2 += d2 - 1;
	if((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400) == 0) {
		if(m2 > 2) { r2 ++; }
	}
	printf("%d", r2 - r1);
	return 0;
}

// 1 1 1??0?
int isRun(int year)
{
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		return 1;
	else
		return 0;
}
int main(int argc, char* argv[])
{
	int startYear, startMonth, startDay ;
	int endYear, endMonth, endDay;

	int startOffset=0, endOffset=0; ///??????????startyear 1-1
	int Month[12]={31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int i, j;

	scanf("%d%d%d",  &startYear, &startMonth, &startDay);
	scanf("%d%d%d",&endYear, &endMonth, &endDay);

	if (isRun(startYear))
	{
		if (startMonth>2)
		{
			for (i=0; i<startMonth-1; i++)
			{
				startOffset+=Month[i];
			}
			startOffset+=1;
			startOffset+=startDay-1;
		}
		else
		{
			for (i=0; i<startMonth-1; i++)
			{
				startOffset+=Month[i];
			}
			startOffset+=startDay-1;
		}
	}
	else
	{
		for (i=0; i<startMonth-1; i++)
		{
			startOffset+=Month[i];
		}
		startOffset+=startDay-1;
	}
	//////////////////////////////////////////////////////////////////////////

	for (j=startYear; j<endYear; j++)
	{
		if (isRun(j))
		{
			endOffset+=366;
		}
		else
			endOffset+=365;
	}

	if (isRun(endYear))
	{
		if (endMonth>2)
		{
			for (i=0; i<endMonth-1; i++)
			{
				endOffset+=Month[i];
			}
			endOffset+=1;
			endOffset+=endDay-1;
		}
		else
		{
			for (i=0; i<endMonth-1; i++)
			{
				endOffset+=Month[i];
			}
			endOffset+=endDay-1;
		}
	}
	else
	{
		for (i=0; i<endMonth-1; i++)
		{
			endOffset+=Month[i];
		}
		endOffset+=endDay-1;
	}

	if (endOffset>=startOffset)
	{
		printf("%d",(endOffset-startOffset));
	}
	
	return 0;
}
int main()
{   
    int sy,sm,sd,ey,em,ed,DS,DE,i,j,k,m,p,n,l,md,
    answer;
    
    n=0;
    l=0;
    DS=0;
    DE=0;
    p=0;
    md=0;
     
    scanf("%d %d %d",&sy,&sm,&sd);
    scanf("%d %d %d",&ey,&em,&ed);
    for(i=1;i<sm;i++)
    {
       if (i==1||i==3||i==5||i==7||i==8||i==10)
          md=31;  
        else if (i==2)
        {if(sy%400==0||(sy%100!=0&&sy%4==0))    md=29;
        else md=28;}
        else md=30;
                   DS=md+DS;
                       }
                       DS=DS+sd;
    for(j=1;sy+j<=ey;j++)
    {
        if ((sy+j-1)%400==0||((sy+j-1)%100!=0&&(sy+j-1)%4==0))
        k=366;
        else k=365;
                      DE=k+DE;}
    for(m=1;m<em;m++)
    {
           if (m==1||m==3||m==5||m==7||m==8||m==10)
          n=31;  
        else if (m==2)
        {if(ey%400==0||(ey%100!=0&&ey%4==0))    n=29;
        else n=28;}
        else n=30;
                       DE=n+DE;
                       }
                       DE=DE+ed;
    answer=DE-DS;
    printf("%d",answer);
}
int dijitian(int year,int month,int day);
int main()
{
	int year1,month1,day1,total=0,year2,month2,day2,result,n;
	scanf("%d%d%d%d%d%d",&year1,&month1,&day1,&year2,&month2,&day2);
	int i;
	if(year1==year2){
		result=dijitian(year2,month2,day2)-dijitian(year1,month1,day1);
	}else{
		for(i=year1+1;i<year2;i++){
			if((i%400==0)||((i%4==0)&&(i%100!=0))){
				total+=366;
			}else{
				total+=365;
			}
		}
		if((year1%400==0)||((year1%4==0)&&(year1%100!=0))){
			result=366-dijitian(year1,month1,day1)+dijitian(year2,month2,day2)+total;
		}else{
			result=365-dijitian(year1,month1,day1)+dijitian(year2,month2,day2)+total;
		}
	}
	printf("%d\n",result);
	return 0;
}
int dijitian(int year,int month,int day){
	int i;
	int total=0;
	for(i=1;i<month;i++){
		if((i==1)||(i==3)||(i==5)||(i==7)||(i==8)||(i==10)||(i==12)){
			total+=31;
		}else if((i==4)||(i==6)||(i==9)||(i==11)){
			total+=30;\
		}else if(i==2){
			if((year%400==0)||((year%4==0)&&(year%100!=0))){
				total+=29;
			}else{
				total+=28;
			}
		}
	}
	total+=day;
	return (total);
}
/*************************
 ***??:??? 1200012776
 ***????:???????????
 ***??:2013?1?2?
 *************************/
int main()
{
	int startyear, startmonth, startday, endyear, endmonth, endday;
	int day_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int day_sum1 = 0, day_sum2 = 0, i, j;
	cin >> startyear >> startmonth >> startday >> endyear >> endmonth >> endday;
	if ((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0))
	{
		day_month[1] = 29;
	}
	for (i = 0; i < startmonth - 1; i++)
	{
		day_sum1 += day_month[i];
	}
	day_month[1] = 28;
	day_sum1 += startday;
	for (i = startyear; i < endyear; i++)
	{
		if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			day_sum2 += 366;
		else
			day_sum2 += 365;
	}
	if ((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0))
	{
		day_month[1] = 29;
	}
	for (i = 0; i < endmonth - 1; i++)
	{
		day_sum2 += day_month[i];
	}
	day_sum2 += endday;
	cout << day_sum2 - day_sum1 << endl;
	return 0;
}