semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int y,m,d,a,i,ans;
    for (i=1;i<=5;i++)
    {
    scanf("%d%d%d",&y,&m,&d); 
    
	if (y%4!=0)
	    a=1;
		else if (y%100!=0) 
			a=0;
			else if (y%400!=0)
			     a=1;
			     else 
			     a=0;
    if (a)
	{
		switch(m)
		{
		  case 1: ans=d; break;
          case 2: ans=31+d; break;
		  case 3: ans=59+d; break;
		  case 4: ans=90+d; break;
		  case 5: ans=120+d; break;
		  case 6: ans=151+d; break;
		  case 7: ans=181+d; break;
		  case 8: ans=212+d; break;
		  case 9: ans=243+d; break;
		  case 10: ans=273+d; break;
		  case 11: ans=304+d; break;
		  case 12: ans=334+d; break;
		}
	}
        else 
		{
		  switch(m)
		  {
		    case 1: ans=d; break;
            case 2: ans=31+d; break;
		    case 3: ans=60+d; break;
		    case 4: ans=91+d; break;
		    case 5: ans=121+d; break;
		    case 6: ans=152+d; break;
		    case 7: ans=182+d; break;
		    case 8: ans=213+d; break;
		    case 9: ans=244+d; break;
		    case 10: ans=274+d; break;
		    case 11: ans=305+d; break;
		    case 12: ans=335+d; break;
		  }
		}
	printf("%d\n",ans); 
         }
}
int main(int argc, char* argv[])
{ 
   int year,month,date;
   int a=0;
   scanf("%d %d %d",&year,&month,&date);
   if(((year%4==0)&&(year%100!=0))||year%400==0){
      switch (month){
          case 1:a=date;break;
          case 2:a=31+date;break;
          case 3:a=31+29+date;break;
          case 4:a=31+29+31+date;break;
          case 5:a=31+29+31+30+date;break;
          case 6:a=31+29+31+30+31+date;break;
          case 7:a=31+29+31+30+31+30+date;break;
          case 8:a=31+29+31+30+31+30+31+date;break;
          case 9:a=31+29+31+30+31+30+31+31+date;break;
          case 10:a=31+29+31+30+31+30+31+31+30+date;break;
          case 11:a=31+29+31+30+31+30+31+31+30+31+date;break;
          case 12:a=31+29+31+30+31+30+31+31+30+31+30+date;break;
      }
   }
   else{
     switch(month){
          case 1:a=date;break;
          case 2:a=31+date;break;
          case 3:a=31+28+date;break;
          case 4:a=31+28+31+date;break;
          case 5:a=31+28+31+30+date;break;
          case 6:a=31+28+31+30+31+date;break;
          case 7:a=31+28+31+30+31+30+date;break;
          case 8:a=31+28+30+31+30+31+date;break;
          case 9:a=31+28+31+30+31+30+31+31+date;break;
          case 10:a=31+28+31+30+31+30+31+31+30+date;break;
          case 11:a=31+28+31+30+31+30+31+31+30+31+date;break;
          case 12:a=31+28+31+30+31+30+31+31+30+31+30+date;break;
      }
   }
   printf("%d\n",a);
   return 0;
}
int main(int argc, char* argv[])
{int year,month,day;
 scanf("%d %d %d",&year,&month,&day);
 int sum=0;
 if(year%4==0&&year%100!=0||year%400==0)
 {int mon[12]={31,29,31,30,31,30,31,31,30,31,30,31};
  if(month==1)
	  sum=day;
  else if(month==2)
	  sum=31+day;
  else 
  {for(int i=0;i<=(month-2);i++)
  {sum+=mon[i];}
   sum=sum+day;
  }
  printf("%d",sum);
 } 
 else if(year%4!=0||year%100==0&&year%400!=0)
  {if(month==1)
   sum=day;
   else if(month==2)
	   sum=31+day;
   else
   {int mon[12]={31,28,31,30,31,30,31,31,30,31,30,31};
   for(int i=0;i<=(month-2);i++)
   {sum+=mon[i];}
    sum=sum+day;
   } printf("%d",sum);
  } 
 
	return 0;
}
int main()
{
	int a,b,c,feb,i,m,n=0,q;
	scanf("%d%d%d",&a,&b,&c);
	if( (a%4==0&&a%100!=0)||a%400==0)
	{
		feb=29;
	}
    else
	{
        feb=28;
	}
	

    for (i=1;i<b;i++)
	{
		if (i==1||i==3||i==5||i==7||i==8||i==10||i==12)
	    	m=31;
        else if(i==2)
	    	m=feb;
     	else
	        m=30;
		n=n+m;
	}
    q=n+c;
	printf("%d",q);
    return 0;
}
int main(int argc, char* argv[])
{
    int year,month,day,a;
    scanf("%d %d %d",&year,&month,&day);
    if(year%4==0&&year%100!=0||year%400==0){
		if(month==1)	
			a=day;
		if(month==2)
			a=day+31;
	    if(month==3)
			a=day+60;
        if(month==4)
			a=day+91;
        if(month==5)
			a=day+121;
        if(month==6)
			a=day+152;
        if(month==7)
			a=day+182;
        if(month==8)
			a=day+213; 
        if(month==9)
			a=day+244;
        if(month==10)
			a=day+274;
        if(month==11)
			a=day+305;
        if(month==12)
			a=day+335;}
		else
		{
        if(month==1)a=day;
		if(month==2)a=day+31;
	    if(month==3)a=day+59;
        if(month==4)a=day+90;
        if(month==5)a=day+120;
        if(month==6)a=day+151;
        if(month==7)a=day+181;
        if(month==8)a=day+212; 
        if(month==9)a=day+243;
        if(month==10)a=day+273;
        if(month==11)a=day+304;
        if(month==12)a=day+334;};
	printf("%d\n",a);
	return 0;
}
main ()
{
     int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
     int year,month,day;
     scanf ("%d %d %d",&year,&month,&day);
     int i,j,k;
     if (year%400==0||year%4==0&&year%100!=0)
     a[1]=29;
     for (i=0,j=day;i<month-1;i++)
     j=j+a[i];
     printf ("%d",j);
     getchar ();
     getchar ();
     }
int main()
{
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int year,month,day,i,k,sum=0;
	cin>>year>>month>>day;
	if (year%400==0)  //????
		k=1;
	else if (year%100==0)
		k=0;
	else if (year%4==0)
		k=1;
	else
		k=0;
	if (k==1)
		a[1]=29;
	for (i=0;i<month-1;i++)
		sum+=a[i];
	sum+=day;
	cout<<sum<<endl;
	return 0;
}
int main(int argc, char* argv[])
{
	int x,y,z,i,n;
	scanf("%d %d %d",&x,&y,&z);
	if(x%400==0)
		i=1;
	else
	{
		if(x%100==0)
			i=0;
		else
		{
			if(x%4==0)
				i=1;
			else
				i=0;
		}
	}
	if(i==1)
	{
		switch(y)
		{
		case 1:n=z;break;
		case 2:n=31+z;break;
		case 3:n=31+29+z;break;
		case 4:n=31+29+31+z;break;
		case 5:n=31+29+31+30+z;break;
		case 6:n=31+29+31+30+31+z;break;
		case 7:n=31+29+31+30+31+30+z;break;
		case 8:n=31+29+31+30+31+30+31+z;break;
        case 9:n=31+29+31+30+31+30+31+31+z;break;
        case 10:n=31+29+31+30+31+30+31+31+30+z;break;
		case 11:n=31+29+31+30+31+30+31+31+30+31+z;break;
		case 12:n=31+29+31+30+31+30+31+31+30+31+30+z;break;
		}
	}
	else
	{
		switch(y)
		{
		case 1:n=z;break;
		case 2:n=31+z;break;
		case 3:n=31+28+z;break;
		case 4:n=31+28+31+z;break;
		case 5:n=31+28+31+30+z;break;
		case 6:n=31+28+31+30+31+z;break;
		case 7:n=31+28+31+30+31+30+z;break;
		case 8:n=31+28+31+30+31+30+31+z;break;
        case 9:n=31+28+31+30+31+30+31+31+z;break;
        case 10:n=31+28+31+30+31+30+31+31+30+z;break;
		case 11:n=31+28+31+30+31+30+31+31+30+31+z;break;
		case 12:n=31+28+31+30+31+30+31+31+30+31+30+z;break;
		}
	}
	printf("%d",n);
	return 0;
}
main()
{
      int day,month,year,sum,leap;
      scanf("%d%d%d",&year,&month,&day);
      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\n");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=sum+1;
      printf("%d\n",sum);
      getchar();
      getchar();
}
int main()
{
    int max[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}, i, rank=0, y, m, d ;
    cin>>y>>m>>d;
    if(y%4==0 && y%100!=0 || y%400==0)
        max[2]+=1;;
    for(i=1;i<m;i++)
    {
        rank+=max[i];            
    }
    rank+=d;
    cout<<rank;
    int x;cin>>x;
    return 0;
}
int main()
{
   int y,m,d,i;
   scanf("%d %d %d",&y,&m,&d);
   int n[12]={31,28,31,30,31,30,31,31,30,31,30,31};
   if(y%100==0&&y%400==0)
     n[1]=29;
   if(y%100!=0&&y&4==0)
     n[1]=29;
   int sum=0;
   for(i=0;i<m-1;i++)
     sum=sum+n[i];
   printf("%d\n",sum+d);
   getchar();
   getchar();  
}
int main()
{
	int year,month,day;
	scanf("%d %d %d",&year,&month,&day);
	int dmonth[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int i=0;
	int sum=0;
	for (i=0;i<month-1;i++){
		sum=sum+dmonth[i];
	}
	if (year%4==0&&year%100!=0||year%400==0){
		if (month>=3){
			sum=sum+day+1;
		}
	}
	else {
		sum=sum+day;
	}
	printf("%d",sum);
	return 0;
}
int main()
{
    int b, c, d, sum=0;
    int a[20];
    a[0]=0;
    a[1]=31;
    a[2]=59;
    a[3]=90;
    a[4]=120;
    a[5]=151;
    a[6]=181;
    a[7]=212;
    a[8]=243;
    a[9]=273;
    a[10]=304;
    a[11]=334;
    a[12]=365;
    scanf("%d%d%d", &b, &c, &d);
    if((b%4!=0)||(b%100==0&&b%400!=0)){
        sum=a[c-1]+d;
    }
    else{
         if(c<3){
         sum=a[c-1]+d;
         }
         else{
             sum=a[c-1]+d+1;
         }   
    }
    printf("%d", sum);
    return 0;
}
int rui(int y,int m){
  if((y%4==0&&y%100!=0)||(y%400==0)&&m==2)
    return 1;
   else return 0;
 }
int main(){
  int d=0,y,m,r,i;
  int pp[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
   cin>>y>>m>>r;
   for(i=1;i<m;i++)
     d=d+pp[i]+rui(y,i);
    d=d+r;
    cout<<d<<endl;
   return 0;
}
int main()
{
      int a,b,c;
      cin>>a>>b>>c;
      if(!((a%4==0&&a%100!=0)||(a%4==0&&a%400==0)))
{if(b==1)
cout<<c;
if(b==2)
cout<<31+c;
if(b==3)
cout<<60+c-1;
if(b==4)
cout<<91+c-1;
if(b==5)
cout<<121+c-1;
if(b==6)
cout<<152+c-1;
if(b==7)
cout<<182+c-1;
if(b==8)
cout<<213+c-1;
if(b==9)
cout<<244+c-1;
if(b==10)
cout<<274+c-1;
if(b==11)
cout<<305+c-1;
if(b==12)
cout<<335+c-1;}
else
{if(b==1)
cout<<c;
if(b==2)
cout<<31+c;
if(b==3)
cout<<60+c;
if(b==4)
cout<<91+c;
if(b==5)
cout<<121+c;
if(b==6)
cout<<152+c;
if(b==7)
cout<<182+c;
if(b==8)
cout<<213+c;
if(b==9)
cout<<244+c;
if(b==10)
cout<<274+c;
if(b==11)
cout<<305+c;
if(b==12)
cout<<335+c;
}return 0;
}
main()
{
      int year,month,day,sum=0,sm=0,k;
      scanf("%d %d %d",&year,&month,&day);
      if((((year%4==0)&&(year%100!=0))||(year%400==0))!=0)
      {
        int m[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
        for(k=0;k<month;k++)
          sum=sum+m[k];
        sum=sum+day;  
        printf("%d",sum);
      } 
      else
      {
        int n[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
        for(k=0;k<month;k++)
          sm=sm+n[k];
          sm=sm+day;
          printf("%d",sm);
      }
      getchar();
      getchar();
}
int main()
{
	int year;
	int month;
	int day;
	int data1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int data2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int in = 0;
	scanf("%d %d %d",&year,&month,&day);
	if ( year%4 == 0 || year%100 == 0 && year%400 == 0)
	{
		int i = month - 1;
		for (; i >= 0; i--)
		{
			in += data2[i];
		}
		in += day;
	}
	else
	{
		int i = month - 1;
		for (; i >= 0; i--)
		{
			in += data1[i];
		}
		in += day;
	}
	printf("%d\n",in);
	return 0;
}
int X1(int y ,int z)//?????????????????
{
    int j;
    switch (y) //?????????????
    {
      case 1:j = z;break;
      case 2:j = 31 + z;break;
      case 3:j = 59 + z;break;
      case 4:j = 90 + z;break;
      case 5:j = 120 + z;break;
      case 6:j = 151 + z;break;
      case 7:j = 181 + z;break;
      case 8:j = 212 + z;break;
      case 9:j = 243 + z;break;
      case 10:j = 273 + z;break;
      case 11:j = 304 + z;break;
      default:j = 334 + z;break;
    }
    return (j);
}
int X2(int y ,int z)//????????????????
{
    int j;
    switch (y) //?????????????
    {
      case 1:j = z;break;
      case 2:j = 31 + z;break;
      case 3:j = 60 + z;break;
      case 4:j = 91 + z;break;
      case 5:j = 121 + z;break;
      case 6:j = 152 + z;break;
      case 7:j = 182 + z;break;
      case 8:j = 213 + z;break;
      case 9:j = 244 + z;break;
      case 10:j = 274 + z;break;
      case 11:j = 305 + z;break;
      default:j = 335 + z;break;
    }
    return (j);
}
int main()
{
	int y , m, d;
	cin>>y>>m>>d;
	cout<<endl;
	int num;
	if (y%100==0)
	{//?????????
	   if (y%400==0)//???????
	      num=X2(m,d);
	   else  num=X1(m,d);
	}
	else 
	{
	   if (y%4==0)//???????
		 num=X2(m,d);
	   else  num=X1(m,d);
	}
	cout<<num<<endl;
	return 0;
}
int main()
{
    int i,p,n[5]={0},year[5],month[5],day[5],days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    for(i=0;i<5;i++)
	{
	scanf("%d%d%d",&year[i],&month[i],&day[i]);
    if ((year[i]%4==0&&year[i]%100!=0)||year[i]%400==0) days[2]=29;
	else days[2]=28;
    for(p=0;p<month[i];p++)
		n[i]=n[i]+days[p];
	n[i]=n[i]+day[i];
	}
    for(i=0;i<5;i++)
	printf("%d\n",n[i]);
	return 0;
}
int main()
{
	int Year,Month,Date;
	int month;
	int i;
	int sum1=0,sum2=0;
	scanf("%d %d %d",&Year,&Month,&Date);
	month=Month-1;
	if(Year%4==0&&Year%400==0){
	   int mday[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	   for(i=0;i<month;i++)
		   sum1=sum1+mday[i];
	}
	else
	{
		int mday[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	    for(i=0;i<month;i++)
		   sum1=sum1+mday[i];
	}
	sum2=sum1+Date;
	printf("\n%d",sum2);
	return 0;
}
void main(){
int a,b,c;
int leap=0;
int day=0;
scanf("%d%d%d",&a,&b,&c);
if(a%400==0||(a%4==0&&a%100!=0))leap=1;
b--;
while(b){
	if(b==1||b==3||b==5||b==7||b==8||b==10||b==12){
		b--;
		day+=31;
	}
		if(b==2){
		b--;
		day+=28+leap;
	}
		if(b==4||b==6||b==9||b==11){
		b--;
		day+=30;
		}
}
day+=c;
printf("%d",day);
}
int main ()
{
	int daysa[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int daysb[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int y,m,d;
	int num=0;
	scanf("%d%d%d",&y,&m,&d);
	int i;
	if((y%4==0&&y%100!=0)||(y%400==0))
	{
		for(i=1;i<=m-1;i++)
		{
			num=num+daysa[i-1];
		}
	    num=num+d;
	}
	else 
	{
		for(i=1;i<=m-1;i++)
		{
			num=num+daysb[i-1];
		}
	    num=num+d;
	}
	printf("%d\n",num);
	return 0;
}
int main()
{
    int year,month,day;
	int n;
	scanf("%d %d %d",&year,&month,&day);
	if((year%4==0 && year%100!=0)||year%400==0) //????
	{
		switch(month){
		    case 1:
				n=day;
				break;
		    case 2:
				n=31+day;
				break;
			case 3:
				n=60+day;
				break;
			case 4:
				n=91+day;
				break;
			case 5:
				n=121+day;
				break;
			case 6:
				n=152+day;
				break;
			case 7:
				n=182+day;
				break;
			case 8:
				n=213+day;
				break;
			case 9:
				n=244+day;
				break;
			case 10:
				n=274+day;
				break;
            case 11:
				n=305+day;
				break;
			case 12:
				n=335+day;
				break;
		}
	}
	else
	{		
		switch(month){
		    case 1:
				n=day;
				break;
		    case 2:
				n=30+day;
				break;
			case 3:
				n=59+day;
				break;
			case 4:
				n=90+day;
				break;
			case 5:
				n=120+day;
				break;
			case 6:
				n=151+day;
				break;
			case 7:
				n=181+day;
				break;
			case 8:
				n=212+day;
				break;
			case 9:
				n=243+day;
				break;
			case 10:
				n=273+day;
				break;
            case 11:
				n=304+day;
				break;
			case 12:
				n=334+day;
				break;
		}
	}
	printf("%d",n);
return 0;
}
int main()
{
 int year,mon,day;
 cin>>year>>mon>>day;
int days=0;
 int ar[12]={31,28,31,30,31,30,31,31,30,31,30,31};
 int br[12]={31,29,31,30,31,30,31,31,30,31,30,31};
 if(year%4==0&&year%100!=0||year%400==0)
 {
 for(int i=0;i<mon-1;i++)
 days+=br[i];
}
else
{
 for(int i=0;i<mon-1;i++)
 days+=ar[i];
}
days+=day;
cout<<days<<endl;
return 0;
}
int main()
{
	int a,b,i,c,days;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d%d%d",&a,&b,&c);
	days=0;
	if((a%4==0&&a%100!=0)||(a%400==0))
	{m[2]=29;
	for(i=0;i<b;i++)
	{days+=m[i];
	}
	printf("%d\n",days+c);
	}
	else
	{
		for(i=0;i<b;i++)
		{
			days+=m[i];
		}
		printf("%d\n",days+c);
	}
	return 0;
}
int main()
{
	int a, b, c, d;
	scanf("%d %d %d",&a, &b, &c); 
	if (a%4 == 0 && a%100 != 0 || a%400 == 0)
	{
		int a[12] = {0,31,60,91,121,152,182,213,244,274,305,335};
		d = a[b-1] + c;
		printf("%d\n", d);
	}
	else
	{
		int a[12] = {0,31,59,90,120,151,181,212,243,273,304,334};
		d = a[b-1] + c;
		printf("%d\n", d);
	}
    return 0;
}
int main()
{
   int a,b,c,n;
   scanf("%d %d %d",&a,&b,&c);
   if(((a%4==0)&&(a%100!=0))||(a%400==0))
   {
	      if(b==1)
			  n=c;
		  else if(b==2)
			  n=31+c;
		  else if(b==3)
			  n=60+c;
		  else if(b==4)
			  n=91+c;
		  else if(b==5)
			  n=121+c;
		  else if(b==6)
			  n=152+c;
		  else if(b==7)
			  n=182+c;
		  else if(b==8)
			  n=213+c;
		  else if(b==9)
			  n=244+c;
		  else if(b==10)
			  n=274+c;
		  else if(b==11)
			  n=305+c;
		  else
			  n=336+c;
   }
   else
   {
	      if(b==1)
			  n=c;
		  else if(b==2)
			  n=31+c;
		  else if(b==3)
			  n=59+c;
		  else if(b==4)
			  n=90+c;
		  else if(b==5)
			  n=120+c;
		  else if(b==6)
			  n=151+c;
		  else if(b==7)
			  n=181+c;
		  else if(b==8)
			  n=212+c;
		  else if(b==9)
			  n=243+c;
		  else if(b==10)
			  n=273+c;
		  else if(b==11)
			  n=304+c;
		  else
			  n=335+c;
   }
   printf("%d",n);
   return 0;
}
int main()
{
	int d,m,y,sum,leap;
	scanf("%d %d %d",&y,&m,&d);
	switch(m)
	{
	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+d;
	if(y%400==0||(y%4==0&&y%100!=0))
		leap=1;
	else
		leap=0;
	if(leap==1&&m>2)
		sum++;
	printf("%d",sum);
}
int main()
{
	int year,month1,day;
	int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>year>>month1>>day;
	int i;
	int sum=0;
	if(((year%4==0)&&(year%100!=0))||(year%400==0)) 
	{
		month[2]=month[2]+1;
		for(i=1;i<month1;i++)
		{
			sum=sum+month[i];
		}
		sum=sum+day;		
	}
	else
	{
	for(i=1;i<month1;i++)
		{
			sum=sum+month[i];
		}
		sum=sum+day;		
	} 
	
	cout<<sum;
	return 0;
	 
}
int panduan(int(year));
int main()
{
	int sum=0,year,month,day;
	int i;
	int Month1[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int Month2[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>year>>month>>day;
	if(panduan(year)==1)
	{
		for(i=1;i<month;i++)
			sum += Month1[i];
	    sum += day;
		cout<<sum;
		return 0;
	}
	else 
	{
		for(i=1;i<month;i++)
			sum += Month2[i];
	    sum += day;
		cout<<sum;
		return 0;
	}
	return 0;
}
int panduan(int year)
{
	if(year%4==0&&year%100!=0||year%400==0)
		return 1;
	else 
		return 0;
}
int main ()
{
	int y = 0, m = 0, d = 0;
    scanf ("%d %d %d", &y, &m, &d);
	int days = 0;
	int i;
	if (y % 4 == 0)
	{
		int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
		for (i = 1; i < m; i++)
		{
			days = month[i] + days;
		}
		days = d + days;
	}
	else
	{
		int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
		for (i = 1; i < m; i++)
		{
			days = month[i] + days;
		}
		days = d + days;
	}
	printf ("%d\n", days);
	return 0;
}
int main() 
{ 
  int year[5], month[5], day[5], total[5],i=0;
  for(;i<=4;i++)
  {

  scanf("%d %d %d", &year[i], &month[i], &day[i]); 
  }
   for(i=0;i<=4;i++)
  {
  switch(month[i])
  {
		case 1: total[i]=day[i];break;
		case 2: total[i]=31+day[i];break;
		case 3: total[i]=31+28+day[i];break;
		case 4: total[i]=31+28+31+day[i];break;
		case 5: total[i]=31+28+31+30+day[i];break;
		case 6: total[i]=31+28+31+30+31+day[i];break;
		case 7: total[i]=31+28+31+30+31+30+day[i];break;
		case 8: total[i]=31+28+31+30+31+30+31+day[i];break;
		case 9: total[i]=31+28+31+30+31+30+31+31+day[i];break;
		case 10: total[i]=31+28+31+30+31+30+31+31+30+day[i];break;
		case 11: total[i]=31+28+31+30+31+30+31+31+30+31+day[i];break;
		case 12: total[i]=31+28+31+30+31+30+31+31+30+31+30+day[i];break;
  }

  if ( (year[i]%400==0||year[i]%4==0&&year[i]%100!=0) && month[i]>2 )  total[i]+=1;
  printf("%d\n",total[i]);
  }
  return 0;
}
int main() {
	int year, month, day, sum = 0;
	cin >> year >> month >> day;
	int m1[12] ={ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	int m2[12] ={ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	for ( int i = 0; i <= month - 1; i ++ ) {
		if ( i == month - 1 ) sum += day;
		else {
			if ( year % 4 == 0 && year % 100 != 0 || year % 400 == 0 ) 
				sum += m2[i];
			else 
				sum += m1[i];
		}
	}
	cout << sum << endl;
	return 0;
}
int main()
{
    int y,m,d,n=0;
    scanf("%d %d %d",&y,&m,&d);
    int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    if(y%4==0&&y%100!=0||y%400==0)
   {
      a[1]=29;
      if(m==1)  
      n=n+d;
     else
    { 
     for(int i=1;i<m;i++)
     n=n+a[i-1];
     n=n+d;
    }
   }
   else
   {
     if(m==1)  
      n=n+d;
    else
    { for(int i=1;i<m;i++)
     n=n+a[i-1];
     n=n+d;
    }
       
    }
    printf("%d",n);
    getchar();
    getchar();
}
int main()
{
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int y,m,d,i,b;
	scanf ("%d%d%d",&y,&m,&d);
	if ((y%4==0&&y%100!=0)||(y%400==0))
		a[2]=a[2]+1;
	b=d;
	for (i=1;i<m;i++)
	{	b=a[i]+b;}
	printf ("%d",b);
	return 0;
}
int main()
{
	int a[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 y,m,d,i,sum=0;
	cin>>y>>m>>d;
	if((y%4==0&&y%100!=0)||(y%400==0))
	{
		for(i=0;i<m-1;i++)
		{
			sum=sum+a[1][i];
		}
	}
	else
	{
		for(i=0;i<m-1;i++)
		{
			sum=sum+a[0][i];
		}
	}
	sum+=d;
	cout<<sum<<endl;
}
int main() 
{
int aaa[5][3];
int year,mon,day,i,n,m;
int month[12];
month[0]=31,month[1]=28,month[2]=31,month[3]=30,month[4]=31,month[5]=30,month[6]=31,month[7]=31,month[8]=30,month[9]=31,month[10]=30,month[11]=31;

for(i=0;i<5;i++)
{
scanf("%d %d %d\n",&year,&mon,&day);
aaa[i][0]=year;
aaa[i][1]=mon;
aaa[i][2]=day;
}
for(i=0;i<5;i++)
{
	year=aaa[i][0];
	mon=aaa[i][1];
	day=aaa[i][2];
if((year % 4 == 0 && year % 100 !=0 ) || year % 400 == 0)
month[1]=29;
else month[1]=28;
n=0;
for(m=0;m<(mon-1);m++)
{
	n=n+month[m];
}
n=n+day;
printf("%d\n",n);
}
}
int shirunnian(int d)
{
	if(d%4==0)
	{
		if(d%100==0)
		{
			if(d%400==0)
				return 1;
			else return 0;
		}
		else return 1;
	}
	else return 0;
}

int dijitian(int a,int b,int c)
{
	int i;
	int sum=0;
	int days=0;
	for(i=0;i<b;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
			days+=31;
		else if(i==4||i==6||i==9||i==11)
			days+=30;
		else if(i==2)
		{
			if(shirunnian(a)==1)
			{
				days+=29;
			}
			else if(shirunnian(a)==0)
			{
				days+=28;
			}
		}
	}
	sum=days+c;
	return sum;
}

int main()
{
	int year,month,day,tianshu=0;
	scanf("%d%d%d", &year,&month,&day);
    tianshu=dijitian(year,month,day);
	printf("%d",tianshu);
	return 0;
}
int main()
{
	int a,b,c,s=0,d=0;
	int i;
	scanf("%d %d %d",&a,&b,&c);
	if(((a%4==0)&&((a%100)!=0))||((a%400)==0))
	{      
		d=1;
	}
	
	for(i=1;i<b;i++)
	{
		if((i==1)||(i==3)||(i==5)||(i==7)||(i==8)||(i==10)||(i==12))
		{
			s=s+31;
		}
		if((i==4)||(i==6)||(i==9)||(i==11))
		{
			s=s+30;
		}
		if(i==2)
		{
			if(d==0)
			{
				s=s+28;
			}
			if(d==1)
			{
				s=s+29;
			}
		}
	}
	s=s+c;
	printf("%d",s);
	return 0;
}
int main()
{
	
	int y,m,d,s,er;
	scanf("%d %d %d",&y,&m,&d);
	if(y%400==0)
	{
		er=29;
		switch(m)
		{
		case 1:s=d;printf("%d\n",s);break;
	    case 2:s=31+d;printf("%d\n",s);break;
	    case 3:s=31+er+d;printf("%d\n",s);break;
	    case 4:s=31*2+er+d;printf("%d\n",s);break;
	    case 5:s=31*2+er+30+d;printf("%d\n",s);break;
	    case 6:s=31*3+er+30+d;printf("%d\n",s);break;
	    case 7:s=31*3+er+30*2+d;printf("%d\n",s);break;
	    case 8:s=31*4+er+30*2+d;printf("%d\n",s);break;
	    case 9:s=31*5+er+30*2+d;printf("%d\n",s);break;
	    case 10:s=31*5+er+30*3+d;printf("%d\n",s);break;
	    case 11:s=31*6+er+30*3+d;printf("%d\n",s);break;
	    case 12:s=31*6+er+30*4+d;printf("%d\n",s);
		}
	}
	else
	{
		er=28;
		switch(m)
		{
		case 1:s=d;printf("%d\n",s);break;
	    case 2:s=31+d;printf("%d\n",s);break;
	    case 3:s=31+er+d;printf("%d\n",s);break;
	    case 4:s=31*2+er+d;printf("%d\n",s);break;
	    case 5:s=31*2+er+30+d;printf("%d\n",s);break;
	    case 6:s=31*3+er+30+d;printf("%d\n",s);break;
	    case 7:s=31*3+er+30*2+d;printf("%d\n",s);break;
	    case 8:s=31*4+er+30*2+d;printf("%d\n",s);break;
	    case 9:s=31*5+er+30*2+d;printf("%d\n",s);break;
	    case 10:s=31*5+er+30*3+d;printf("%d\n",s);break;
	    case 11:s=31*6+er+30*3+d;printf("%d\n",s);break;
	    case 12:s=31*6+er+30*4+d;printf("%d\n",s);
		}
	}
	return 0;
}
int main()
{
    int year,month,day,result=0,i;
    scanf("%d%d%d",&year,&month,&day);
    for(i=1;i<month;i++)
    {
        if(i==1||i==3||i==5||i==7||i==8||i==10){
              result+=31;
        }
        else if(i==4||i==6||i==9||i==11){
              result+=30;
        }
        else if(i==2){
              if(year%400==0||(year%4==0&&year%100!=0)){
                    result+=29;
              }
              else 
                    result+=28;
        }
        
    }
    result+=day;
    printf("%d",result);
    return 0;
}