semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
long total;

int run(int n)
{
	if (n%4==0 && n%100!=0)
	{
		return 1;
	}
	if (n%400==0)
	{
		return 1;
	}
	return 0;
}

int main()
{
	int year,month,day;
	int i;
	while (cin>>year>>month>>day)
	{
		total=0;
		if (run(year))
		{
		
				if (month==1)
				{
					total+=day;
				}
				if (month==2)
				{
					total+=31+day;
				}
				switch (month)
				{
					case 3:total+=60+day;break;
					case 4:total+=91+day;break;
					case 5:total+=121+day;break;
					case 6:total+=152+day;break;
					case 7:total+=182+day;break;
					case 8:total+=213+day;break;
					case 9:total+=244+day;break;
					case 10:total+=274+day;break;
					case 11:total+=305+day;break;
					case 12:total+=335+day;break;
				}
		}
		else
		{
				if (month==1)
				{
					total+=day;
				}
				if (month==2)
				{
					total+=31+day;
				}
				switch (month)
				{
					case 3:total+=59+day;break;
					case 4:total+=90+day;break;
					case 5:total+=120+day;break;
					case 6:total+=151+day;break;
					case 7:total+=181+day;break;
					case 8:total+=212+day;break;
					case 9:total+=243+day;break;
					case 10:total+=273+day;break;
					case 11:total+=304+day;break;
					case 12:total+=334+day;break;
				}
		}
		cout<<total<<endl;
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int year,mon,day,i;
	int total=0;
	scanf("%d%d%d",&year,&mon,&day);

	if (year % 4 == 0 && year % 100 !=0  || year % 400 ==0){
		int a[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
		for(i=0;i<mon;i++){
		
			total=total+a[i];
        }
        
	}
else {
			int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
             for(i=0;i<mon;i++){
				 
			total=total+a[i];
			 }
	}
           total+=day;
		printf("%d",total);

	return 0;
}
int main()
{
	int yy,mm,dd,i,n=0;
	scanf("%d%d%d",&yy,&mm,&dd);
	if(yy%4==0&&yy%100!=0||yy%400==0)
	{
		for(i=1;i<mm;i++)
		{
			switch(i)
			{
			case 1:
					n=n+31;
					break;
			case 2:

					n=n+29;
					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;
			case 12:
					n=n+31;
					break;

			}
		}

			n=n+dd;
			printf("%d",n);


	}

	else
	{
		for(i=1;i<mm;i++)
		{
			switch(i)
			{
			case 1:
					n=n+31;
					break;
			case 2:
					n=n+28;
					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;
			case 12:
					n=n+31;
					break;

			}
		}

			n=n+dd;
			printf("%d",n);

	}

	return 0;
}
int main(int argc, char* argv[])
{
	int m,n,p,a;
	scanf("%d%d%d",&m,&n,&p);
	if (m%4!=0||(m%100==0&&m%400!=0))
	{
	if(n==1)
	{
		a=p;
	}
	else if ((n+1)%2==0&&(n+1)>9)
	{
	a=61*(n-1)/2-1+p;
	}
	else if((n-1)%2==0&&(n+1)<9)
	{
	a=61*(n-1)/2-2+p;
	
	}
else if(n==2)
	{
		a=31+p;
	}
	
		
		else
	{
		a=61*(n-2)/2+29+p;
	}

	}
	else
{
	if((n-1)%2==0&&(n+1)<9)
	{
	a=61*(n-1)/2-1+p;
	
	}
	else if ((n+1)%2==0&&(n+1)>9)
	{
	a=61*(n-1)/2+p;
	}
	else if(n==1)
	{
		a=p;
	}
else if(n==2)
	{
		a=31+p;
	}
	
		
		else
	{
		a=61*(n-2)/2+30+p;
	}

	}
	
	
	printf("%d",a);
	return 0;
}
int runnian(int a)
{
	if(a%4==0&&a%400==0)
		return 1;
	if(a%4==0&&a%100!=0)
		return 1;
	else return 0;
}
int tian(int nian,int yue,int ri)
{
	int sum=0,i;
	int run[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int feirun[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	if(runnian(nian)==1)
	{
		for(i=0;i<=yue-2;i++)
			sum+=run[i];
		sum+=ri;
	}
	else 
	{
		for(i=0;i<=yue-2;i++)
			sum+=feirun[i];
		sum+=ri;
	}
	return sum;
}

int main()
{
	int nian,yue,ri;
	cin>>nian>>yue>>ri;
	cout<<tian(nian,yue,ri)<<endl;
	return 0;
}
int main()
{
   int year,mon,day,n,leap;
   scanf("%d %d %d",&year,&mon,&day);
   if(year%4==0)
     {
        if(year%100==0)
           {
              if(year%400==0)
                  leap=1;
              else
                  leap=0;
            }
        else
            leap=1;
      }
   else
       leap=0;
   if(leap=0){
      switch(mon)
      {
        case 1:n=day;break;
        case 2:n=31+day;break;
        case 3:n=31+29+day;break;
        case 4:n=31+29+31+day;break;
        case 5:n=31+29+31+30+day;break;
        case 6:n=31+29+31+30+31+day;break;
        case 7:n=31+29+31+30+31+30+day;break;
        case 8:n=31+29+31+30+31+30+31+day;break;
        case 9:n=31+29+31+30+31+30+31+31+day;break;
        case 10:n=31+29+31+30+31+30+31+31+30+day;break;
        case 11:n=31+29+31+30+31+30+31+31+30+31+day;break;
        case 12:n=31+29+31+30+31+30+31+31+30+31+30+day;break;
     }
     printf("%d",n);
   }
   else
    {
      switch(mon)
      {
         case 1:n=day;break;
        case 2:n=31+day;break;
        case 3:n=31+28+day;break;
        case 4:n=31+28+31+day;break;
        case 5:n=31+28+31+30+day;break;
        case 6:n=31+28+31+30+31+day;break;
        case 7:n=31+28+31+30+31+30+day;break;
        case 8:n=31+28+31+30+31+30+31+day;break;
        case 9:n=31+28+31+30+31+30+31+31+day;break;
        case 10:n=31+28+31+30+31+30+31+31+30+day;break;
        case 11:n=31+28+31+30+31+30+31+31+30+31+day;break;
        case 12:n=31+28+31+30+31+30+31+31+30+31+30+day;break;
      }
      printf("%d",n);
     }
return 0;
}
int isrunnian(int year)
{
	if(year%400==0)
		return 1;
	else if(year%4==0&&year%100!=0)
		return 1;
	else
		return 0;
}
int main()
{
	int y,m,d;
	scanf("%d%d%d",&y,&m,&d);
	if(m==1)
		printf("%d\n",d);
	else if(m==2)
		printf("%d\n",31+d);
	else if(m==3)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+d);
		else
			printf("%d\n",31+28+d);
	}
	else if(m==4)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+d);
		else
			printf("%d\n",31+28+31+d);
	}	
	else if(m==5)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+d);
		else
			printf("%d\n",31+28+31+30+d);
	}	
	else if(m==6)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+31+d);
		else
			printf("%d\n",31+28+30+31+31+d);
	}	
	else if(m==7)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+31+30+d);
		else
			printf("%d\n",31+28+31+30+31+30+d);
	}	
	else if(m==8)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+31+30+31+d);
		else
			printf("%d\n",31+28+31+30+31+30+31+d);
	}	
	else if(m==9)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+31+30+31+31+d);
		else
			printf("%d\n",31+28+31+30+31+30+31+31+d);
	}	
	else if(m==10)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+31+30+31+31+30+d);
		else
			printf("%d\n",31+28+31+30+31+30+31+31+30+d);
	}	
	else if(m==11)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+31+30+31+31+30+31+d);
		else
			printf("%d\n",31+28+31+30+31+30+31+31+30+31+d);
	}	
	else if(m==12)
	{
		if(isrunnian(y))
	    	printf("%d\n",31+29+31+30+31+30+31+31+30+31+30+d);
		else
			printf("%d\n",31+28+31+30+31+30+31+31+30+31+30+d);
	}
	return 0;
}
int leap(int y)
{
		if (
		   (y%100==0)&&(y%400==0)
		   ||
					(y%100!=0)&&(y%4==0)
					)
				return 1; else return 0;
}

int days(int y,int d,int r)
{
		int a[13]={0,0,31,28,31,30,31,30,31,31,30,31,30};
		if (leap(y)) a[3]=29;
		int ans=0;
		for (int i=1;i<=d;i++) ans+=a[i];
		return ans+r;
}
int main()
{
	int y,d,r;
	cin>>y>>d>>r;
	//if (leapyear(y)) cout<<'N'; else cout<<'N';
	cout<<days(y,d,r);
}
int main(int argc, char* argv[])
{
	int year,m,d,result=0;
	scanf ("%d%d%d",&year,&m,&d);
	for (int i=1;i<m;i++){
		if (i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			result+=31;
		else if (i==2){
				if (year%400==0||year%4==0&&year%100!=0)
					result+=29;
				else
					result+=28;
			}
			else
				result+=30;
	}
	result+=d;
	printf ("%d\n",result);
	return 0;
}
// Provided the value of year, month and day, 
// what day is it in this year? 

//    1. January, 31 days 
//    2. February, 28 days, 29 in leap years 
//    3. March, 31 days 
//    4. April, 30 days 
//    5. May, 31 days 
//    6. June, 30 days 
//    7. July, 31 days 
//    8. August, 31 days 
//    9. September, 30 days 
//    10. October, 31 days 
//    11. November, 30 days 
//    12. December, 31 days 
static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 

// The Gregorian calendar, the current standard calendar in most of the world, 
// adds a 29th day to February in all years evenly divisible by 4, except for 
// centennial years (those ending in -00), which receive the extra day only if 
// they are evenly divisible by 400. 
static int isleapyear(int year) { 
  return (year % 4 == 0 && year % 100 !=0 ) || year % 400 == 0; 
} 

int main() { 
  int year, month, day; 
  int j;
 
  for(j=0;j<5;j++){
   int n = 0;  // to store the result.
  int i; 
    scanf("%d %d %d", &year, &month, &day); 
	

  // Check the input. 
  if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) { 
    printf("Illegal input.\n"); 
    return -1; 
  } 
  if (isleapyear(year) && month != 2 && (day < 1 || day > days[month])) { 
    printf("Illegal input.\n"); 
    return -1; 
  } 
  if (!isleapyear(year) && (day < 1 || day > days[month])) { 
    printf("Illegal input.\n"); 
    return -1; 
  } 

  // add days of former months. 
  for (i = 1; i < month; i++) { 
    n += days[i]; 
  } 
  // add days of this month. 
  n += day; 
  // check leap year 
  if (month > 2 && isleapyear(year)) 
    n++; 

  printf("%d\n", n); 
  }
  return 0;
}
int main()
{
	int A[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int B[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int y,m,d,i;

    scanf("%d%d%d",&y,&m,&d);
	int s=d;
	if((y%4==0&&y%100!=0)||(y%400==0))
	{for(i=0;i<(m-1);i++)
	{s+=B[i];
	}
	printf("%d",s);}
    else
	{for(i=0;i<(m-1);i++)
	{
     s+=A[i];
	}
	printf("%d",s);}
	return 0;
}
int main()
{
	int year,month,day,res=0,i;
	int y[12];
	scanf("%d %d %d",&year,&month,&day);
	if(((year%4==0)&&(year%100!=0))||(year%400==0))
		y[1]=29;
	else
		y[1]=28;
	y[0]=31;
	y[2]=31;
	y[4]=31;
	y[7]=31;
	y[6]=31;
	y[9]=31;
	y[3]=30;
	y[5]=30;
	y[8]=30;
	y[10]=30;
	for(i=0;i<month-1;i++)
		res+=y[i];
	res+=day;
	printf("%d",res);
}
int main(int argc, char* argv[])
{
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if(a%400==0||(a%4==0&&a%100!=0))
	{
		if(b==1)printf("%d\n",c);
		else if(b==2)printf("%d\n",c+31);
		else if(b==3)printf("%d\n",c+31+29);
		else if(b==4)printf("%d\n",c+31+29+31);
		else if(b==5)printf("%d\n",c+31+29+31+30);
		else if(b==6)printf("%d\n",c+31+29+31+30+31);
		else if(b==7)printf("%d\n",c+31+29+31+30+31+30);
		else if(b==8)printf("%d\n",c+31+29+31+30+31+30+31);
		else if(b==9)printf("%d\n",c+31+29+31+30+31+30+31+31);
		else if(b==10)printf("%d\n",c+31+29+31+30+31+30+31+31+30);
		else if(b==11)printf("%d\n",c+31+29+31+30+31+30+31+31+30+31);
		else printf("%d\n",c+31+29+31+30+31+30+31+31+30+31+30);
	}
	else
	{
		if(b==1)printf("%d\n",c);
		else if(b==2)printf("%d\n",c+31);
		else if(b==3)printf("%d\n",c+31+28);
		else if(b==4)printf("%d\n",c+31+28+31);
		else if(b==5)printf("%d\n",c+31+28+31+30);
		else if(b==6)printf("%d\n",c+31+28+31+30+31);
		else if(b==7)printf("%d\n",c+31+28+31+30+31+30);
		else if(b==8)printf("%d\n",c+31+28+31+30+31+30+31);
		else if(b==9)printf("%d\n",c+31+28+31+30+31+30+31+31);
		else if(b==10)printf("%d\n",c+31+28+31+30+31+30+31+31+30);
		else if(b==11)printf("%d\n",c+31+28+31+30+31+30+31+31+30+31);
		else printf("%d\n",c+31+28+31+30+31+30+31+31+30+31+30);
	}
	return 0;
}
int main()
{
	int y,m,d,s;
	scanf("%d%d%d",&y,&m,&d);
	if(m==1)
	{
		s=d;
	}
	else if(m==2)
	{
		s=d+31;
	}
	else if(m==3)
	{
		s=d+59;
	}
	else if(m==4)
	{
		s=d+90;
	}
	else if(m==5)
	{
		s=d+120;
	}
	else if(m==6)
	{
		s=d+151;
	}
	else if(m==7)
	{
		s=d+181;
	}
	else if(m==8)
	{
		s=d+212;
	}
	else if(m==9)
	{
		s=d+243;
	}
	else if(m==10)
	{
		s=d+273;
	}
	else if(m==11)
	{
		s=d+304;
	}
	else
	{
		s=d+334;
	}
	if(!((y%400==0)||(y%100!=0&&y%4==0)))
	{
		printf("%d",s);
	}
	else
	{
		if(m<3)
		{
			printf("%d",s);
		}
		else
		{
			printf("%d",s+1);
		}
	}
	return 0;
}
int main()
{  int l,m,n,t,i,s;
  scanf("%d%d%d",&l,&m,&n);
   if(l%4==0&&l%100!=0)
	   t=29;
   if(l%4!=0)
	   t=28;
   if(l%100==0&&l%400!=0)
      t=28;
   if(l%400==0)
	   t=29;
   int a[13]={0,31,t,31,30,31,30,31,31,30,31,30,31};
      if(m==1)
		  s=n;
	  else
		s=n;
     for(i=1;i<m;i++)
	 {s=s+a[i];}
	 printf("%d",s);
	 return 0;
}
int main()
{
	int year,month,day,n=0,i,num=0;
	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",&year,&month,&day);
	if((year%4==0&&year%100!=0)||year%400==0)
	{
		for(i=0;i<month-1;i++)
		{
			n=n+B[i];
		}
		num=n+day;
		printf("%d",num);
	}
	else
	{
		for(i=0;i<month-1;i++)
		{
			n=n+A[i];
		}
		num=n+day;
		printf("%d",num);
	}
	return 0;
}
int main()
{
	int a,b,c,d;
	scanf("%d %d %d",&a,&b,&c);
	if(a%400==0)
	{
		if(b==1)
			d=c;
        if(b==2)
			d=31+c;
        if(b==3)
			d=60+c;
        if(b==4)
			d=91+c;
        if(b==5)
			d=121+c;
         if(b==6)
			d=152+c;
         if(b==7)
			d=182+c;
          if(b==8)
			d=213+c;
          if(b==9)
			d=244+c;
          if(b==10)
			d=275+c;
         if(b==11)
			d=305+c;
           if(b==12)
			d=335+c;
		   printf("%d",d);
	} 
	else
	{
	if(a%4==0&&a%100!=0)
	{
		if(b==1)
			d=c;
        if(b==2)
			d=31+c;
        if(b==3)
			d=60+c;
        if(b==4)
			d=91+c;
        if(b==5)
			d=121+c;
         if(b==6)
			d=152+c;
         if(b==7)
			d=182+c;
          if(b==8)
			d=213+c;
          if(b==9)
			d=244+c;
          if(b==10)
			d=275+c;
         if(b==11)
			d=305+c;
           if(b==12)
			d=335+c;
         printf("%d",d);
	} 
	else
	{
		if(b==1)
			d=c;
        if(b==2)
			d=31+c;
        if(b==3)
			d=59+c;
        if(b==4)
			d=90+c;
        if(b==5)
			d=120+c;
         if(b==6)
			d=151+c;
         if(b==7)
			d=181+c;
          if(b==8)
			d=212+c;
          if(b==9)
			d=243+c;
          if(b==10)
			d=274+c;
         if(b==11)
			d=304+c;
           if(b==12)
			d=334+c;
        printf("%d",d);
	} 
	}
	return 0;
}
int main()
{
    int year,month,day,D;
    scanf("%d%d%d",&year,&month,&day);
    if(month==1)
    {
        D=day;
     }
    if(month==2)
    {
        D=day+31;
     }
    if((year%4==0)&&(year%100!=0)||(year%400==0))
    {
        if(month==3)
        {
           D=day+31+29;
         }
        if(month==4)
        {
           D=day+31+29+31;
         }
        if(month==5)
        {
           D=day+31+29+31+30;
        }
        if(month==6)   
        {
           D=day+31+29+31+30+31;
        }
         if(month==7)   
        {
           D=day+31+29+31+30+31+30;
        }
         if(month==8)   
        {
           D=day+31+29+31+30+31+30+31;
        }
         if(month==9)   
        {
           D=day+31+29+31+30+31+30+31+31;
        }
         if(month==10)   
        {
           D=day+31+29+31+30+31+30+31+31+30;
        }
         if(month==11)   
        {
           D=day+31+29+31+30+31+30+31+31+30+31;
        }
         if(month==12)   
        {
           D=day+31+29+31+30+31+30+31+31+30+31+30;
        }
    }
    else
    {
        if(month==3)
        {
           D=day+31+28;
         }
        if(month==4)
        {
           D=day+31+28+31;
         }
        if(month==5)
        {
           D=day+31+28+31+30;
        }
        if(month==6)   
        {
           D=day+31+28+31+30+31;
        }
         if(month==7)   
        {
           D=day+31+28+31+30+31+30;
        }
         if(month==8)   
        {
           D=day+31+28+31+30+31+30+31;
        }
         if(month==9)   
        {
           D=day+31+28+31+30+31+30+31+31;
        }
         if(month==10)   
        {
           D=day+31+28+31+30+31+30+31+31+30;
        }
         if(month==11)   
        {
           D=day+31+28+31+30+31+30+31+31+30+31;
        }
         if(month==12)   
        {
           D=day+31+28+31+30+31+30+31+31+30+31+30;
        }
    }
    printf("%d\n",D);
    return 0;
}
int main ()
{
	int year, month, day, num;
	scanf("%d%d%d",&year,&month,&day);
	if(year%4==0&&year%100!=0||year%400==0)
	{
		if(month==1)
		{
			num=day;
			printf("%d\n",num);
		}
        if(month==2)
		{
			num=day+31;
			printf("%d\n",num);
		}
        if(month==3)
		{
			num=day+31+29;
			printf("%d\n",num);
		}
        if(month==4)
		{
			num=day+31+29+31;
			printf("%d\n",num);
		}
        if(month==5)
		{
			num=day+31+29+31+30;
			printf("%d\n",num);
		}
        if(month==6)
		{
			num=day+31+29+31+30+31;
			printf("%d\n",num);
		}
        if(month==7)
		{
			num=day+31+29+31+30+31+30;
			printf("%d\n",num);
		}
        if(month==8)
		{
			num=day+31+29+31+30+31+30+31;
			printf("%d\n",num);
		}
        if(month==9)
		{
			num=day+31+29+31+30+31+30+31+31;
			printf("%d\n",num);
		}
        if(month==10)
		{
			num=day+31+29+31+30+31+30+31+31+30;
			printf("%d\n",num);
		}
        if(month==11)
		{
			num=day+31+29+31+30+31+30+31+31+30+31;
			printf("%d\n",num);
		}
        if(month==12)
		{
			num=day+31+29+31+30+31+30+31+31+30+31+30;
			printf("%d\n",num);
		}
	}
	else
	{
		if(month==1)
		{
			num=day;
			printf("%d\n",num);
		}
        if(month==2)
		{
			num=day+31;
			printf("%d\n",num);
		}
        if(month==3)
		{
			num=day+31+28;
			printf("%d\n",num);
		}
        if(month==4)
		{
			num=day+31+28+31;
			printf("%d\n",num);
		}
        if(month==5)
		{
			num=day+31+28+31+30;
			printf("%d\n",num);
		}
        if(month==6)
		{
			num=day+31+28+31+30+31;
			printf("%d\n",num);
		}
        if(month==7)
		{
			num=day+31+28+31+30+31+30;
			printf("%d\n",num);
		}
        if(month==8)
		{
			num=day+31+28+31+30+31+30+31;
			printf("%d\n",num);
		}
        if(month==9)
		{
			num=day+31+28+31+30+31+30+31+31;
			printf("%d\n",num);
		}
        if(month==10)
		{
			num=day+31+28+31+30+31+30+31+31+30;
			printf("%d\n",num);
		}
        if(month==11)
		{
			num=day+31+28+31+30+31+30+31+31+30+31;
			printf("%d\n",num);
		}
        if(month==12)
		{
			num=day+31+28+31+30+31+30+31+31+30+31+30;
			printf("%d\n",num);
		}
	}
	return 0;
}
void main()
{
   int i;
   long a[5];
   int b[5],c[5],g[5];
   i=1;
   while(i<=5)
  {
   scanf("%ld %d %d",&a[i],&b[i],&c[i]);
   i++;
   }
   i=1;
   while(i<=5)
  {
   g[i]=0;
   switch(b[i])
	{
	case 12: g[i]+=30;
	case 11: g[i]+=31;
	case 10: g[i]+=30;
	case 9: g[i]+=31;
	case 8: g[i]+=31;
	case 7: g[i]+=30;
	case 6: g[i]+=31;
	case 5: g[i]+=30;
	case 4: g[i]+=31;
	case 3: g[i]+=28;
	case 2: g[i]+=31;
	case 1: g[i]+=0;break;
	default: printf("error\n");
	}
   if(((a[i]%4==0&&a[i]%100!=0)||(a[i]%400==0))&&(b[i]>=3))
       c[i]=c[i]+1;
   printf("%d\n",g[i]+c[i]);
   i++;
  }
}
int main(int argc, char* argv[])
{
	int year,month,day,month2,n;
	scanf("%d %d %d",&year,&month,&day);
		if (year%4==0&&year%100!=0||year%400==0)
			month2=29;
		else
			month2=28;
if (month==1)
	n=day;
if (month==2) 
    n=31+day;
if(month==3)
    n=31+month2+day;
if(month==4)
   n=31+month2+31+day;
if(month==5)
  n=31+month2+31+30+day;
if(month==6)
 n=31+month2+31+30+31+day;  
if(month==7)
n=31+month2+31+30+31+30+day;
if(month==8)
n=31+month2+31+30+31+30+31+day;
if(month==9)
n=31+month2+31+30+31+30+31+31+day;
if(month==10)
n=31+month2+31+30+31+30+31+31+30+day;
if(month==11)
n=31+month2+31+30+31+30+31+31+30+31+day;
if(month==12)
n=31+month2+31+30+31+30+31+31+30+31+30+day;
printf("%d",n);
 return 0;
}
int ping(int n)
{
	if(n==1||n==3||n==5||n==7||n==8||n==10||n==12)
		return 31;
	if(n==2)
		return 28;
	if(n==4||n==6||n==9||n==11)
		return 30;
}
int run(int n)
{
	if(n==1||n==3||n==5||n==7||n==8||n==10||n==12)
		return 31;
	if(n==2)
		return 29;
	if(n==4||n==6||n==9||n==11)
		return 30;
}

int main()
{
	int n,month,day,sum=0;
	cin>>n>>month>>day;	
	int i;
	if((n%400==0)||(n%4==0&&n%100!=0))
	{
		for(i=1;i<month;i++)
			sum+=run(i);
		sum+=day;
		cout<<sum;
	}		
	else 
	{
			for(i=1;i<month;i++)
				sum+=ping(i);
			sum+=day;
			cout<<sum;
	}
	return 0;
}
// Provided the value of year, month and day,
// what day is it in this year?

//    1. January, 31 days
//    2. February, 28 days, 29 in leap years
//    3. March, 31 days
//    4. April, 30 days
//    5. May, 31 days
//    6. June, 30 days
//    7. July, 31 days
//    8. August, 31 days
//    9. September, 30 days
//    10. October, 31 days
//    11. November, 30 days
//    12. December, 31 days
static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

// The Gregorian calendar, the current standard calendar in most of the world,
// adds a 29th day to February in all years evenly divisible by 4, except for
// centennial years (those ending in -00), which receive the extra day only if
// they are evenly divisible by 400.
static int isleapyear(int year) {
  return (year % 4 == 0 && year % 100 !=0 ) || year % 400 == 0;
}

int main() {
  int year, month, day;
  scanf("%d %d %d", &year, &month, &day);

  // Check the input.
  if (isleapyear(year) && month == 2 && (day < 1 || day > 29)) {
    printf("Illegal input.\n");
    return -1;
  }
  if (!isleapyear(year) && (day < 1 || day > days[month])) {
    printf("Illegal input.\n");
    return -1;
  }

  int n = 0;  // to store the result.
  int i;
  // add days of former months.
  for (i = 1; i < month; i++) {
    n += days[i];
  }
  // add days of this month.
  n += day;
  // check leap year
  if (isleapyear(year) && month > 2)
    n++;

  printf("%d", n);
}
main(){
	int year,month,day;
	scanf("%d %d %d",&year,&month,&day);
	int i;
	
	if(year%4==0||year%100==0){
		if(month==1){
			i=day;
		}
		else if(month==2){
			i=(month-1)*31+day;
		}
		else{
			i=(month-1)*31+day-month/2-1;
		}
	}
	else{
		if(month==1){
			i=day;
		}
		else if(month==2){
			i=(month-1)*31+day;
		}
		else{
			i=(month-1)*31+day-month/2-1;
		}
	}
	
	printf("%d",i);






	return 0;
}
int main()
{
	int rn[11] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};
	int pn[11] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};
	
	int y, m, d, dday;
	int i, j;

	int *x;
	int n = 5;
	x = malloc(15*sizeof(int));

	for(i=0; i<n; i++)
	{
		scanf("%d %d %d", x+i*3, x+i*3+1, x+i*3+2);
	}


	for(i=0; i<n; i++)
	{
		dday = 0;
		y = *(x+i*3);
		m = *(x+i*3+1);
		d = *(x+i*3+2);
		if(y %4  ==0  && y % 100 !=0 || y % 400 ==0)
		{
			for(j = 0; j< m-1; j++)
				dday = dday + rn[j];
		}
		else
		{
			for(j = 0; j< m-1; j++)
				dday = dday + pn[j];
		}
		dday = dday + d;
		printf("%d\n", dday);
	}

	return 0;
}
int leap(int);
int main()
{
	int y,month,d,sum=0;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>y>>month>>d;
	m[2]=m[2]+leap(y);
	for(int i=0;i<month;i++)
	{
		sum=sum+m[i];
	}
	sum=sum+d;
	cout<<sum<<endl;
	return 0;
}
int leap(int n)
{
	if((n%4==0&&n%100!=0)||(n%400==0))
		return 1;
	else
		return 0;
}
const int month[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 main()
{
	int i,leap=0,y,m,d,ans=0;
	cin>>y>>m>>d;
	if ((y%4==0)&&(y%100!=0)||(y%400==0)) leap=1;
	for (i=1;i<m;i++) ans+=month[leap][i];
	ans+=d;
	cout<<ans<<endl;
	return 0;
}
void main()
{
	int a[10], b[10], c[10],n[10],d,i;
	for(i=0;i<5;i++)
	{
	scanf("%d%d%d",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<5;i++)
	{
	if((a[i]%4==0&&a[i]%100!=0)||a[i]%400==0)
	{
		switch(b[i])
	{
case 1: d=0;break;
case 2: d=31;break;
case 3: d=60;break;
case 4: d=91;break;
case 5: d=121;break;
case 6: d=152;break;
case 7: d=182;break;
case 8: d=213;break;
case 9: d=244;break;
case 10: d=274;break;
case 11: d=305;break;
case 12: d=335;break;
	}
	n[i]=d+c[i];
	printf("%d\n",n[i]);
	}
		else
	{
switch(b[i])
	{
case 1: d=0;break;
case 2: d=31;break;
case 3: d=59;break;
case 4: d=90;break;
case 5: d=120;break;
case 6: d=151;break;
case 7: d=181;break;
case 8: d=212;break;
case 9: d=243;break;
case 10: d=273;break;
case 11: d=304;break;
case 12: d=334;break;
	}
n[i]=d+c[i];
printf("%d\n",n[i]);
		}
}
}
//#include <math.h>
int main(int argc, char* argv[])
{			
    int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31,30,31};
	int y,m,d,i,c;
	scanf("%d%d%d",&y,&m,&d);
	if((y%4==0)&&(y%100!=0)||(y%400)==0)
	{
		days[2]++;
	}
	c=d;
	for(i=1;i<m;i++)
	{
		c+=days[i];
	}
	printf("%d",c);
	return 0;
}