semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
// ???????.cpp 


int main()
{
	int y1, m1, d1, y2, m2, d2;
	int i, num = 0, k;
	cin >> y1 >> m1 >> d1;
	cin >> y2 >> m2 >> d2;
	k = ((y1 % 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0));
	for (i = y1; i < y2; i++)
		num = num + 365 + ((i % 4 == 0  && i % 100 != 0) || (i % 400 == 0));
	for (i = 1; i < m1; i++)
	{
		switch (i)
		{
		case 1: num = num - 31; break;
		case 2: num = num - (28 + k); break;
		case 3: num = num - 31; break;
		case 4: num = num - 30; break;
		case 5: num = num - 31; break;
		case 6: num = num - 30; break;
		case 7: num = num - 31; break;
		case 8: num = num - 31; break;
		case 9: num = num -30; break;
		case 10: num = num - 31; break;
		case 11: num = num - 30; break;
		}
	}
	num = num - d1 + d2;
	k = ((y2 % 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0));
	for (i = 1; i < m2; i++)
	{
		switch (i)
		{
		case 1: num = num + 31; break;
		case 2: num = num + (28 + k); break;
		case 3: num = num + 31; break;
		case 4: num = num + 30; break;
		case 5: num = num + 31; break;
		case 6: num = num + 30; break;
		case 7: num = num + 31; break;
		case 8: num = num + 31; break;
		case 9: num = num + 30; break;
		case 10: num = num + 31; break;
		case 11: num = num + 30; break;
		}
	}
	cout << num << endl;
	return 0;
}
int main()
{
    int ya,ma,da,yb,mb,db,s=0,i,mon1[13]={0,31,29,31,30,31,30,31,31,30,31,30,31},mon2[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},q;
    cin>>ya>>ma>>da>>yb>>mb>>db;
    for(i=ya;i<yb;i++)
    {
		if((i%4==0&&i%100!=0)||(i%400==0))s=s+366;
		else s=s+365;
	}
	if((yb%4==0&&yb%100!=0)||(yb%400==0))
	{
		for(i=ma;i<mb;i++)
		{
			s=s+mon1[i];
		}
		for(i=mb;i<ma;i++)
		{
			s=s-mon1[i];
		}
	}
	else
	{
		for(i=ma;i<mb;i++)
		{
			s=s+mon2[i];
		}
		for(i=mb;i<ma;i++)
		{
			s=s-mon2[i];
		}
	}
	s=s+db-da;
	cout<<s;
	cin>>q;
	return 0;
	
}
int main()
{
	int total(int year,int month,int day);
	int yearo, montho, dayo, totalo,totalt,yeart, montht, dayt,t,y,i,temp=0;
	scanf("%d %d %d",&yearo, &montho, &dayo);
	scanf("%d %d %d",&yeart, &montht, &dayt);
//	if((yearo>yeart)||((yearo=yeart)&&(montho>montht))||((yearo=yeart)&&(montho=montht)&&(dayo>dayt)))
		
//	{	totalo=total(yeart, montht, dayt);
//		totalt=total(yearo, montho, dayo);
//		yearo=y;
///		yearo=yeart;
//		yeart=y;
//	}
//	else
//			{
				totalo=total(yearo, montho, dayo);
		totalt=total(yeart, montht, dayt);
//	}
	t=totalt-totalo+365*(yeart-yearo);
	for(i=yearo;i<=yeart;i++)
	{
		if(((i % 4 == 0) &&( i % 100 != 0))|| (i % 400 == 0))
		t++;
	}
			printf("%d",t);
	return 0;
}

	
int total(int year,int month,int day)	
{	int i;
		int mday[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
		int total=0;
		for( i=1; i<month; i++)
		{
			total = total + mday[i-1];
		}
//		if( ((year%4==0&&year%100!=0) || year%400==0 )&&(month>2))
//			total = total + 1;
		total = total + day;		
	return total;
}
int main()
{
	int by,bm,bd;
	cin >> by >> bm >> bd;
	int ey, em ,ed;
	cin >> ey >> em >> ed;
	int sum = 0;
	for (int i = by + 1; i < ey; i++)
	{
		int leap = (i % 400 == 0) || (i % 100 != 0 && i % 4 == 0);
		sum = sum + (leap == 1 ? 366 : 365);
	}
	int temp = by == ey ? em : 12;
	for (int i = bm; i <= temp; i++)
	{
		int leapb = (by % 400 == 0) || (by % 100 != 0 && by % 4 == 0);
		if (i == 2)
		{
			if (leapb)
				sum += 29;
			else
				sum += 28;
		}
		switch (i)
		{
			
			case 1:sum += 31; break;
			case 3:sum += 31; break;
			case 5:sum += 31; break;
			case 7:sum += 31; break;
			case 8:sum += 31; break;
			case 10:sum += 31; break;
			case 12: sum += 31; break;
			case 4:sum += 30; break;
			case 6:sum += 30; break;
			case 9:sum += 30; break;
			case 11: sum += 30; break;
		}
	}
	sum -= bd;
	temp = by == ey ? bm : 1;
	for (int i = temp; i <= em - 1; i++)
	{
		int leape = (ey % 400 == 0) || (ey % 100 != 0 && ey % 4 == 0);
		if (i == 2)
		{
			if (leape)
				sum += 29;
			else
				sum += 28;
		}
		switch (i)
		{
			case 1:sum += 31; break;
			case 3:sum += 31; break;
			case 5:sum += 31; break;
			case 7:sum += 31; break;
			case 8:sum += 31; break;
			case 10:sum += 31; break;
			case 12: sum += 31; break;
			case 4:sum += 30; break;
			case 6:sum += 30; break;
			case 9:sum += 30; break;
			case 11: sum += 30; break;
		}
	}
	sum += ed;
	if (by == ey && bm == em)
	{
		int leape = (ey % 400 == 0) || (ey % 100 != 0 && ey % 4 == 0);
		if (bm == 2)
		{
			if (leape)
				sum -= 29;
			else
				sum -= 28;
		}
		switch (bm)
		{
			case 1:sum -= 31; break;
			case 3:sum -= 31; break;
			case 5:sum -= 31; break;
			case 7:sum -= 31; break;
			case 8:sum -= 31; break;
			case 10:sum -= 31; break;
			case 12: sum -= 31; break;
			case 4:sum -= 30; break;
			case 6:sum -= 30; break;
			case 9:sum -= 30; break;
			case 11: sum -= 30; break;
		}
	}

	cout << sum << endl;
	return 0;
}
int DiJiTian(int year,  int month,  int day);
int isRunNian(int   year);
void swap(int *a,  int *b);
int main()
{
	int a,b,c,i;
	int  year1,  month1,  day1;
	int  year2,  month2,  day2;
	int  result = 0;

	scanf( "%d %d %d",  &year1,  &month1,  &day1);
	scanf( "%d %d %d",  &year2,  &month2,  &day2);
	
	if(year1==year2)
	{
		result = DiJiTian(year1, month1, day1) - DiJiTian(year2, month2, day2);
        if(result < 0)	
			result = 0 - result;
	}
	else
	{
		if(year1 > year2)
		{
	        swap(&year1, &year2);
	        swap(&month1, &month2);
          	swap(&day1, &day2);
		}
		if( isRunNian(year1) )
	        a = 366 - DiJiTian(year1, month1, day1);
        else
        	a = 365 - DiJiTian(year1, month1, day1);
		b = 0;
        for( i = year1 + 1; i < year2; i++){
        	if(isRunNian(i))
	        	b += 366;
        	else
        		b += 365;
		}
		c = DiJiTian(year2, month2, day2);
		result=a+b+c;
	}
	printf("%d",result);
	return 0;
}
int isRunNian(int year){
	int result;
	if( year%400 == 0 ||(year%4==0 && year%100!=0) )
		result = 1;
	else
		result = 0;
	return   result;	
}
int DiJiTian(int year, int month, int day)
{
        int  result = 0,  i;
        for( i = 1;  i < month;  i++){ 	//step1
	if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
	        result += 31;	
	 else  if (i == 4 || i ==6 || i == 9 || i==11)
  	        result += 30;
	else   if(i == 2){
	        if( isRunNian(year) ) 
		result += 29;
	        else
		result += 28;
	}
       }
       result += day;         //step2
       return  result;	
}
void swap(int *a, int *b)
{
	int e;
	e = *a;
	*a = *b;
	*b = e; 
}
double h,r;

int i,ans = 0,year1,year2,month1,month2,day1,day2,
    num_month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

int main()
{
    scanf("%d%d%d%d%d%d",&year1,&month1,&day1,
                         &year2,&month2,&day2);
    for(i = year1 + 1;i < year2;++i)
        if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
            ++ans;
    ans += 365 * (year2 - year1 - 1);
    for(i = 1;i <= month2 - 1;++i)
        ans += num_month[i];
    for(i = month1 + 1;i <= 12;++i)
        ans += num_month[i];
    ans += day2 + num_month[month1] - day1;
    if((year1 % 4 == 0 && year1 % 100 != 0 || year1 % 400 == 0) && month1 <= 2)
        ++ans;
    if((year2 % 4 == 0 && year2 % 100 != 0 || year2 % 400 == 0) && month2 > 2)
        ++ans;
    printf("%d\n",ans);
    return 0;    
}
void main()
{
	int y1,m1,d1,y2,m2,d2,num1,num2,num,k;
	scanf("%d %d %d\n%d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
	switch(m1)
	{
	case(1):
		num1=365-d1;break;
	case(2):
		num1=365-d1-31;break;
	case(3):
		num1=365-d1-31-28;break;
	case(4):
		num1=365-d1-31*2-28;break;
	case(5):
		num1=365-d1-31-28-30;break;
	case(6):
		num1=365-d1-31*3-28-30;break;
	case(7):
		num1=365-d1-31*3-28-30*2;break;
	case(8):
		num1=365-d1-31*4-28-30*2;break;
	case(9):
		num1=365-d1-31*5-28-30*2;break;
	case(10):
		num1=365-d1-31*5-28-30*3;break;
	case(11):
		num1=365-d1-31*6-28-30*3;break;
	case(12):
		num1=365-d1-31*7-28-30*4;break;
	}
	switch(m2)
	{
	case(1):
		num2=d2;break;
	case(2):
		num2=d2+31;break;
	case(3):
		num2=d2+31+28;break;
	case(4):
		num2=d2+31*2+28;break;
	case(5):
		num2=d2+31+28+30;break;
	case(6):
		num2=d2+31*3+28+30;break;
	case(7):
		num2=d2+31*3+28+30*2;break;
	case(8):
		num2=d2+31*4+28+30*2;break;
	case(9):
		num2=d2+31*5+28+30*2;break;
	case(10):
		num2=d2+31*5+28+30*3;break;
	case(11):
		num2=d2+31*6+28+30*3;break;
	case(12):
		num2=d2+31*6+28+30*4;break;
	}
	num=num1+num2+365*(y2-y1-1);
	for(k=y1+1;k<y2;k++)
		if((k% 4 == 0 && k % 100 != 0) || (k % 400 == 0))
			num++;
	if(((y1% 4 == 0 && y1 % 100 != 0) || (y1 % 400 == 0)) && ((m1==1) ||(m1==2 && d1!=29) ))
		num++;
	if(((y2% 4 == 0 && y2 % 100 != 0) || (y2 % 400 == 0)) && m2>=3)
		num++;
	printf("%d",num);
}
int month[13]={0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};


int yadd(int y)
{
 if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) return 1;
 else return 0;
}
int madd(int y, int m)
{
 if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) 
	 if (m == 2) return 1;
 return 0;
}
int ydays(int y1, int y2)
{
	int ans = 0;
	while (y1!=y2) 
	{
		ans += yadd(y1) + 365;
		y1++;
	}
	return ans;
}
int mdays(int y, int m, int d)
{
	int ans=0, i, j;
	// month
	i=1; 
	while (i<m)
	{
		ans += month[i] + madd(y, i);
		i++;
	}
	ans += d;
	return ans;
}
int main(){
	int y1, y2, m1, m2, d1, d2;
	int ans;
	scanf("%d %d %d", &y1, &m1, &d1);
	scanf("%d %d %d", &y2, &m2, &d2);
	ans = ydays(y1, y2) - mdays(y1, m1, d1) + mdays(y2, m2, d2);
	printf("%d", ans);
	return 0;
}
int djt(int year,int month,int day);
int main()
{
	  int a,b,c,d,e,f,g,h,s,i;
	scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
	g=djt(a,b,c);h=djt(d,e,f);s=h-g;
	for(i=a;i<d;i++)
	{
		if(i%400==0||(i%4==0&&i%100!=0))
			s+=366;
		else
			s+=365;
	}
			printf("%d\n",s);
	return 0;
}
int djt(int year,int month,int day)
{
	int sum,leap;
	  switch(month) /*?????????????*/
  {
    case 1:sum=0;break;
    case 2:sum=31;break;
    case 3:sum=59;break;
    case 4:sum=90;break;
    case 5:sum=120;break;
    case 6:sum=151;break;
    case 7:sum=181;break;
    case 8:sum=212;break;
    case 9:sum=243;break;
    case 10:sum=273;break;
    case 11:sum=304;break;
    case 12:sum=334;break;
    default:printf("data error");break;
  }
  sum=sum+day; /*????????*/
  if(year%400==0||(year%4==0&&year%100!=0)) /*???????*/
    leap=1;
  else
    leap=0;
  if(leap==1&&month>2) /*??????????,????????*/
    sum++;
  return sum;
}
int main()
{
	int i, year, startyear, startmonth, startday, endyear, endmonth, endday, sum = 0;
	int a[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	cin >> startyear>> startmonth>> startday>> endyear>> endmonth>> endday;
	if ((endyear - startyear) > 1)
	{
		for (year = startyear + 1; year < endyear; year++)
		{
			if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) 
				sum += 366;
			else
				sum += 365;
		}
		for (i = startmonth - 1; i < 12; i++)
			sum += a[i];
		sum -= startday;
		for (i = 0; i < endmonth - 1; i++)
			sum += a[i];
		sum += endday;
	}
	else if ((endyear - startyear) == 1)
		{
		for (i = startmonth; i < 12; i++)
			sum += a[i];
		sum -= startday;
		for (i = 0; i < endmonth; i++)
			sum += a[i];
		sum += endday;
		}
	else
	{
		for (i = startmonth; i < endmonth - 1; i++)
			sum += a[i];
		if (startmonth != endmonth)
			sum = sum + a[startmonth - 1] - startday + endday;
		else
			sum = sum + endday - startday;
	}
	if ((startyear % 4 == 0 && startyear % 100 != 0) || (startyear % 400 == 0))
		if (startmonth == 1 || (startmonth == 2 && startday != 29))
			sum++;
	if ((endyear % 4 == 0 && endyear % 100 != 0) || (endyear % 400 == 0))
		if (endmonth > 2)
			sum++;
	cout << sum;
	return 0;
}
/*
 * qimokaoshi_3.cpp
 *??:???????????
 *  Created on: 2011-1-9
 *      Author: jsgl
 */

int year1,year2,month1,month2,day1,day2,d1,d2=0,i;
int a[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
int ntianshu(int year)
{
    if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
       return 366;
    return 365;
}
int tianshu(int y,int m,int d)
{
	if(ntianshu(y)==366)  a[2]=29;
	else a[2]=28;
	int day=0;
	for(int i=1;i<=m-1;i++)
		day=day+a[i];
	return day+d;
}
int main()
{
	cin>>year1>>month1>>day1;
	cin>>year2>>month2>>day2;
	d1=tianshu(year1,month1,day1);
	for(i=year1;i<=year2-1;i++)
		d2=d2+ntianshu(i);
	d2=d2+tianshu(year2,month2,day2);
	cout<<d2-d1;
return 0;
}
void main()
{
	int sy,sm,sd,ey,em,ed,i,days,x,y;
	int a[13];
	days=x=y=0;
	scanf("%d%d%d",&sy,&sm,&sd);
	scanf("%d%d%d",&ey,&em,&ed);
	a[1]=a[3]=a[5]=a[7]=a[8]=a[10]=a[12]=31;
	a[4]=a[6]=a[9]=a[11]=30;
    if ((sy % 4 == 0 && sy % 100 != 0) || (sy % 400 == 0))
		a[2]=29;
    else a[2]=28;
	for(i=1;i<sm;i++)
           x+=a[i];
	x+=sd;
    if ((ey % 4 == 0 && ey % 100 != 0) || (ey % 400 == 0))
		a[2]=29;
    else a[2]=28;
	for(i=1;i<em;i++)
           y+=a[i];
	y+=ed;
    for(i=sy;i<ey;i++)
	{
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
                days+=366;
		else days+=365;
	}
	days=days+y-x;
	printf("%d",days);
}
int main()
{
	int sY, sM, sD, eY, eM, eD;
	int month1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int month2[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int pD = 0, spD = 0, epD = 0, ypD = 0;
	int i;
	cin >> sY >> sM >> sD >> eY >> eM >> eD;
	if(sY % 4 == 0 && sY % 100 != 0 || sY % 400 == 0)
	{
		for(i = 1; i < sM; i++)
		{
			spD += month2[i - 1];
		}
		spD += sD;
		spD = 366 - spD;
	}
	else
	{
		for(i = 1; i < sM; i++)
		{
			spD += month1[i - 1];
		}
		spD += sD;
		spD = 365 - spD;
	}
	if(eY % 4 == 0 && eY % 100 != 0 || eY % 400 == 0)
	{
		for(i = 1; i < eM; i++)
		{
			epD += month2[i - 1];
		}
		epD += eD;
	}
	else
	{
		for(i = 1; i < eM; i++)
		{
			epD += month1[i - 1];
		}
		epD += eD;
	}
	if(sY == eY)
	{
		if(sY % 4 == 0 && sY % 100 != 0 || sY % 400 == 0)
		{
			pD = spD + epD - 366;
		}
		else
		{
			pD = spD + epD - 365;
		}
	}
	else
	{
		for(i = sY + 1; i < eY; i++)
		{
			if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
			{
				ypD += 366;
			}
			else
			{
				ypD += 365;
			}
		}
		pD = spD + epD + ypD;
	}
	cout << pD << endl;
	return 0;
}
int main()
{
	int day[2][12] = {{31,29 ,31,30 ,31 , 30 , 31 ,31 , 30 ,31 , 30 ,31},{31,28 ,31,30 ,31 , 30 , 31 ,31 , 30 ,31 , 30 ,31}};
	int year1 , year2 , month1 ,month2 ,day1, day2 , i , j , k , sum=0 , past= 0 , will= 0;
	cin >> year1 >> month1 >> day1 ;
	cin >> year2 >> month2 >> day2 ;
	if (year1 == year2)
	{
		if ((year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0) )
		{	
			for (i = month1 ; i <=month2 ;i++)
				sum+= day[0][i-1] ;
			sum = sum - day1 - (day[0][month2-1] - day2 ) ;
			cout << sum ;
		}
		else
		{
			for (i = month1 ; i <=month2 ;i++)
				sum+= day[1][i-1] ;
			sum = sum - day1 - (day[1][month2-1] - day2 ) ;
			cout << sum ;
		}
	}
	else
	{
		for (i = year1 ; i < year2 ; i++)
		{
			if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
			{
				for (j = 0 ; j< 12 ; j++)
					sum+=day[0][j] ;
			}
			else
				for (j = 0 ; j < 12 ; j++)
					sum+=day[1][j] ;
		}
		if ((year1 % 4 == 0 && year1 % 100 != 0) || (year1 % 400 == 0))
		{	
			for (i = 0 ; i < month1 ;i++)
				past+= day[0][i] ;
			past = past - (day[0][month1-1] - day1 ) ;
				sum = sum - past ;
		}
		else
		{
			for (i = 0 ; i < month1 ;i++)
				past+= day[1][i] ;
			past = past - (day[1][month1-1] - day1 ) ;
			sum = sum - past ;
		}
		if ((year2 % 4 == 0 && year2 % 100 != 0) || (year2 % 400 == 0))
		{	for (i = 0 ; i < month2 ;i++)
				will+= day[0][i] ;
			will = will - (day[0][month2-1] - day2 ) ;
				sum = sum + will ;
			cout << sum ;
		}
		else
		{
			for (i = 0 ; i < month2 ;i++)
				will+= day[1][i] ;
			will = will - (day[0][month2-1] - day2 ) ;
			sum = sum + will ;
			cout << sum ;
		}
	}
	return 0 ;
}
int mds[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};
int leap(int year)
{
    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
    return 1;
    return 0;
}

int days(int sm, int sd, int em, int ed, int y)
{
    int lm, ld, um, ud;
    int total;
    if (sm < em)
    {
        lm = sm; um = em; ld = sd; ud = ed;
    }
    else if (sm > em)
    {
         lm = em; um = sm; ld = ed; ud = sd;
    }
    else if (sm == em)
    {
         if (sd > ed) return (sd - ed);
         return (ed - sd);
    }
    for (int i = lm; i < um; i++)
        total += mds[leap(y)][i - 1];
    if (ud > ld) total += ud - ld;
    else total -= ud - ld;
    return total;
}

int main()
{
    int sy, sm, sd, ey, em, ed, cd = 0;
    cin >> sy >> sm >> sd >> ey >> em >> ed;
    int i;
    for (i = sy; i < ey; i++)
        cd += leap(i) + 365;
    if (em > sm || (em == sm && ed >= sd))
        cd += days(sm, sd, em, ed, ey);
    else cd -= days(sm, sd, em, ed, ey) - 1;
    cout << cd << endl;
    return 0;
}
int main() {
	int a[2][3];
	int i,j,n=0,m=0,p=0;
	int b[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int c[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	

	for(i=0;i<2;i=i+1){
		for(j=0;j<3;j=j+1){
			scanf("%d",&a[i][j]);
		}
		
	}
	if(a[0][0]!=a[1][0]){
	for(i=a[0][0]+1;i<=a[1][0]-1;i=i+1){
		if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)){
			n=n+366;
			
		}
		else{
			n=n+365;
		}
		
	}
	if((a[1][0] % 4 == 0 && a[1][0] % 100 != 0) || (a[1][0] % 400 == 0)){
		for(i=0;i+1<=a[1][1]-1;i=i+1){
		m=m+c[i];	
		}
		m=m+a[1][2];
		
	}
    else{
		for(i=0;i+1<=a[1][1]-1;i=i+1){
		m=m+b[i];	
		}
		m=m+a[1][2];
	
	}
	if((a[0][0] % 4 == 0 && a[0][0] % 100 != 0) || (a[0][0] % 400 == 0)){
		for(i=a[0][1];i+1<=12;i=i+1){
		p=p+c[i];	
		}
		p=p+c[a[0][1]-1]-a[0][2];
	
	}
	else{
		for(i=a[0][1];i+1<=12;i=i+1){
		p=p+b[i];	
		}
		p=p+b[a[0][1]-1]-a[0][2];
	
	}
}

else {
    if(a[0][1]!=a[1][1]){
	    if((a[1][0] % 4 == 0 && a[1][0] % 100 != 0) || (a[1][0] % 400 == 0)){
	    	for(i=a[0][1]-1;i+1<=a[1][1]-1;i=i+1){
			n=n+c[i];
		}
		n=n-a[0][2]+a[1][2];
	}
	else{
		for(i=a[0][1]-1;i+1<=a[1][1]-1;i=i+1){
			n=n+b[i];
		}
		n=n-a[0][2]+a[1][2];
		
	}

	
	
}
else{
	n=a[1][2]-a[0][2];
}
}
	

	n=n+m+p;
	printf("%d",n);
	
	
	
	
	
	
	return 0;
}
int main ( )
{
	int i, j, num = 0, startYear, startMonth, startDay, endYear, endMonth, endDay,
		Year[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> startYear >> startMonth >> startDay >> endYear >> endMonth >> endDay;
	if (startYear == endYear)
	{
		if((startYear % 4 == 0 && startYear % 100 != 0)||(startYear % 400 == 0))
				Year[1] = 29;
		else Year[1] = 28;
		if(startMonth == endMonth)
			num = num + endDay - startDay;
		else
		{
			for (i = startMonth-1;i < endMonth;i++)
			{
				if(i == startMonth-1)
					num = num + Year[i] - startDay;
				else if(i == endMonth-1)
					num = num + endDay;
				else num = num + Year[i];
			}
		}
	}
	else
	{
		for(j = startYear;j <= endYear;j++)
		{
			if(j == startYear)
			{
				if((startYear % 4 == 0 && startYear % 100 != 0)||(startYear % 400 == 0))
					Year[1] = 29;
				else Year[1] = 28;
				for (i = startMonth-1;i < 12;i++)
				{
					if (i == startMonth-1)
						num = num + Year[i] - startDay;
					else num = num + Year[i];
				}
			}
			else if (j == endYear)
			{
				if((endYear % 4 == 0 && endYear % 100 != 0)||(endYear % 400 == 0))
					Year[1] = 29;
				else Year[1] = 28;
				for (i = 0;i < endMonth;i++)
				{
					if (i == endMonth - 1)
						num = num + endDay;
					else num = num + Year[i];
				}
			}
			else
			{
				if((j % 4 == 0 && j % 100 != 0)||(j % 400 == 0))
					Year[1] = 29;
				else Year[1] = 28;
				for (i = 0;i < 12;i++)
					num = num + Year[i];
			}
	    }
	}
	cout << num <<endl;
	return 0;
}
int main()
{
  int y1,m1,d1,y2,m2,d2;
  cin>>y1>>m1>>d1>>y2>>m2>>d2;
  int f(int,int,int);
  cout<<f(y2,m2,d2)-f(y1,m1,d1)<<endl;
  return 0;
}
int f(int y,int m,int d)
{  
  int num,i,j,k,s1=0,s2=0; 
  int c[3100];
  int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  int b[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
  for(i=0;i<=3050;i++)
   {
   if(i%4!=0||i%100==0&&i%400!=0) c[i]=365;
   else c[i]=366;
   }
     for(i=0;i<=y-1;i++)
   s1=s1+c[i];
   for(i=0;i<=m-1;i++)
   {
   if(y%4!=0||y%100==0&&y%400!=0)
       s2=s2+a[i];
   else s2=s2+b[i];
  }
 num=s1+s2+d;
return (num);
}
int year[3001]={0};
int remain(int y,int m,int d);
int main()
{
	int i,sum=0,year1,mon1,day1,year2,mon2,day2;
	cin>>year1>>mon1>>day1>>year2>>mon2>>day2;
	for(i=1;i<=3000;i++)
	{
		if((i%4==0&&i%100!=0)||(i%400==0))
			year[i]=366;
		else 
			year[i]=365;
	}
	if(year1<year2)
	{
		for(i=year1+1;i<year2;i++)
			sum+=year[i];
		sum+=remain(year1,mon1,day1)+year[year2]-remain(year2,mon2,day2);
	}
	else if(year1==year2)
	{
		sum+=remain(year1,mon1,day1)-remain(year2,mon2,day2);
	}
	cout<<sum<<endl;
	return 0;
}

int remain(int y,int m,int d)
{
	int k=0,i,month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	if(year[y]==365)
	{
		k+=month[m]-d;
		for(i=m+1;i<=12;i++)
			k+=month[i];
	}
	else
	{
		month[2]=29;
		k+=month[m]-d;
		for(i=m+1;i<=12;i++)
			k+=month[i];
	}
	return k;
}
int main()
{
	int y[2],m[2],d[2];
	int td=0,tm=0,ty=0,t,s;
	int i;
	int mon_1[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int mon_2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	cin>>y[0]>>m[0]>>d[0]>>y[1]>>m[1]>>d[1];
	td=d[1]-d[0];
	if((y[1]% 4 == 0&&y[1] % 100 != 0) || (y[1] % 400 == 0))
	{
		if(m[1]<m[0])
			for(i=m[1];i<m[0];i++)
				tm=tm-mon_2[i-1];
		else if(m[1]>m[0])
			for(i=m[0];i<m[1];i++)
				tm=tm+mon_2[i-1];
	}
	else
	{
		if(m[1]<m[0])
			for(i=m[1];i<m[0];i++)
				tm=tm-mon_1[i-1];
		else if(m[1]>m[0])
			for(i=m[0];i<m[1];i++)
				tm=tm+mon_1[i-1];
	}
	if(y[1]>y[0])
	{
	if(m[0]<=2)
	{
		if((y[0]% 4 == 0&&y[0] % 100 != 0) || (y[0] % 400 == 0))
			ty=ty+366;
		else
			ty=ty+365;
	}
	else
	{
		ty=ty+365;
	}
	}
	for(i=y[0]+1;i<y[1];i++)
	{
		if((i% 4 == 0&&i% 100 != 0) || (i% 400 == 0))
			ty=ty+366;
		else
			ty=ty+365;
	}
	//cout<<td<<" "<<tm<<" "<<ty<<endl;
	s=td+tm+ty;
	cout<<s<<endl;
	return 0;
}
int main (){
int year1,month1,day1,year2,month2,day2;
int total=0;
scanf("%d %d %d",&year1,&month1,&day1);
scanf("%d %d %d",&year2,&month2,&day2);
while((year1!=year2)||(month1!=month2)||(day1!=day2)){
	if(month1==1||month1==3||month1==5||month1==7||month1==8||month1==10){
		if(day1<31){
		day1++;
		total++;
		}else if(day1==31){
		day1=0;
		month1++;
		}
	}
	if(month1==4||month1==6||month1==9||month1==11){
		if(day1<30){
		day1++;
		total++;
		}else if(day1==30){
		day1=0;
		month1++;
		}
    }
	if(month1==2){
		if((year1%4==0&&year1%100!=0)||(year1%400==0)){
		if(day1<29){
		day1++;
		total++;
		}else if(day1==29){
		day1=0;
		month1++;
		} 
		}else{
		if(day1<28){
		day1++;
		total++;
		}else if(day1==28){
		day1=0;
		month1++;
		}
		}
	}
   if(month1==12){
		if(day1<31){
		day1++;
		total++;
		}else if(day1==31){
		day1=0;
		month1=1;
		year1++;
		}
   }
}
printf("%d",total);
return 0;
}
int main()
{
	int sy,sm,sd,ey,em,ed,i,sum=0,a=0;
	int day[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
	scanf("%d %d %d",&sy,&sm,&sd);
	scanf("%d %d %d",&ey,&em,&ed);
	for(i=sy+1;i<=ey-1;i++)
		if((i%4==0&&i%100!=0)||(i%400==0))
			sum+=366;
		else sum+=365;
    if((ey%4==0&&ey%100!=0)||(ey%400==0))
		for(i=1;i<em;i++)
			if(i==2) sum+=29;
			else sum+=day[i];
	else for(i=1;i<em;i++)
	    	if(i==2) sum+=28;
			else sum+=day[i];
	if(ey!=sy)
	{
		if((sy%4==0&&sy%100!=0)||(sy%400==0))
		{
		   for(i=1;i<sm;i++)
			  if(i==2) a+=29;
			  else a+=day[i];
	    	sum=sum+366-(a+sd);
		}
	   else 
	   {
		   for(i=1;i<sm;i++)
	    	  if(i==2) a+=28;
			  else a+=day[i];
		   sum=sum+365-(a+sd);
	   }
	}
	else 
	{
		if((sy%4==0&&sy%100!=0)||(sy%400==0))
		{
		   for(i=1;i<sm;i++)
			  if(i==2) a+=29;
			  else a+=day[i];
	    	sum=sum-(a+sd);
		}
	   else 
	   {
		   for(i=1;i<sm;i++)
	    	  if(i==2) a+=28;
			  else a+=day[i];
		   sum=sum-(a+sd);
	   }
	 }
	sum+=ed;
	printf("%d\n",sum);
	return 0;
}
int main()
{
	int sy,sm,sd,ey,em,ed,i,sum=0;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int b[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	scanf("%d %d %d",&sy,&sm,&sd);
	scanf("%d %d %d",&ey,&em,&ed);
    for(i=sy;i<=ey;i++)
	{
		sum=sum+365;
		if((i%4==0&&i%100!=0)||(i%400==0))
			sum=sum+1;
	}
	for(i=1;i<=sm-1;i++)
	{   if(sm!=1)
	{
		if((sy%4==0&&sy%100!=0)||(sy%400==0))
		sum=sum-b[i];
	    else sum=sum-a[i];}
	}
	for(i=em;i<=12;i++)
	{
		
		
        if((ey%4==0&&ey%100!=0)||(ey%400==0))
		sum=sum-b[i];
		else sum=sum-a[i];}
	
	sum=sum+ed-sd;
	printf("%d",sum);
}