semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int year,month,day,days=0,i=1;
	int month_str1[12]={31,28,31,30,31,30,31,31,30,31,30,31},month_str2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	cin>>year>>month>>day;
	if((year%4==0&&year%100!=0)||year%400==0)
		while(i!=month)
		{
			days+=month_str2[i-1];
			i++;
		}
	else
		while(i!=month)
		{
			days+=month_str1[i-1];
			i++;
		}
	cout<<days+day;
	return 0;
}
int main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    int k[20];
    k[1]=31;k[2]=28;k[3]=31;k[4]=30;k[5]=31;k[6]=30;k[7]=31;k[8]=31;k[9]=30;
    k[10]=31;k[11]=30;k[12]=31;
    int i=1;
    int sum=0;
    while (i<b)
    {
          sum = sum+k[i];
          i++;
    }
    sum=sum+c;
    if (b>2)
    {if ((a%4==0&&a%100!=0)||a%400==0)
      
    sum++;
      }
    printf("%d\n",sum);
    getchar();
    getchar();
}
int main()
{
	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};
	int y,m,d,l=0;
	cin>>y>>m>>d;
	if(y%4!=0||(y%100==0&&y%400!=0))//???
	{
		if(m==1)
			cout<<d;
		else
		{
			for(int i=0;i<m-1;i++)
			{
				l+=a[i];
			}
			cout<<l+d;
		}
	}
	else
	{
		if(m==1)
			cout<<d;
		else
		{
			for(int i=0;i<m-1;i++)
			{
				l+=b[i];
			}
			cout<<l+d;
		}
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int year,month,d;
	int result=0;
    int i;
    int a[12]={31,28,31,30,31,30,31,31,31,31,30,31};
	scanf("%d%d%d",&year,&month,&d);
	if ((year % 4 == 0 && year % 100 !=0 ) || year % 400 == 0){
		a[2]=a[2]+1;
		for(i=1;i<month;i++){
			result+=a[i];
		}
		result+=d;
	}
	else
    	         for(i=1;i<month;i++){
			result+=a[i];
		}
		result+=d;
	printf("%d\n",result);
	return 0;

}
int main()
{
	int yn , mn , dn ;
	int result=0;
	scanf("%d %d %d" , &yn , &mn , &dn );
	if ( yn%4==0 && yn%100!=0 || yn%400==0 )
	{
		int day_of_month[13]={0,31,29,31,30,31,30,31,30,31,31,30,31};
		int i=1;
		while ( i < mn )
		{
			result=result+day_of_month[i];
			i++;
		}
		result=result+dn ;		
	}
	else
	{
		int day_of_month[13]={0,31,28,31,30,31,30,31,30,31,31,30,31};
	    int i=1;		
		while ( i < mn )
		{
			result=result+day_of_month[i];
			i++;
		}
		result=result+dn ;
	}
	printf ("%d" , result );	
	return 0;
}
int main()
{
	int y,m,d,x=0,i,a[12]={31,29,31,30,31,30,31,31,30,31,30,31},b[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>y>>m>>d;
	if(m==1)
		x=d;
	else if(m==2)
		x=31+d;
	else if(y%100!=0&&y%4==0||y%400==0)
	{
		for(i=0;i<m-1;i++)
			x+=a[i];
		x+=d;
	}
	else
	{
		for(i=0;i<m-1;i++)
			x+=b[i];
		x+=d;
	}
	cout<<x<<endl;
	return 0;
}
int r(int x)
{ if(x%4!=0||(x%100==0&&x%400!=0))
     return(0);
     else
     return(1);
}

main()
{   int m,y,i,j,d,s,t;
    scanf("%d %d %d",&m,&y,&d);
    int a[13];
    a[1]=31;a[3]=31;a[4]=30;a[5]=31;a[6]=30;a[7]=31;a[8]=31;a[9]=30;a[10]=31;a[11]=30;a[12]=31;
                    
    if(r(m)==1)
       a[2]=29;
    else
       a[2]=28;
    for(s=0,i=1;i<y;i++)
        s=s+a[i];
      
       s=s+d;
      
       printf("%d",s);
       

  getchar();
  getchar();
  getchar();
  getchar();
      }
int main()
{
int a[3]={0},b[12]={31,28,31,30,31,30,31,31,30,31,30,31},sum=0,i;
cin>>a[0]>>a[1]>>a[2];
if (a[0] % 4 == 0 && a[0] %100 !=0 || a[0]%400 ==0) b[1]=29;
for (i=0;i<a[1]-1;i++) sum+=b[i];
sum+=a[2];
cout<<sum;



}
int f(int x)
{
 int z;
 if((x%4==0)&&(x%100!=0)||(x%400==0)) z=1;
 else z=0;
 return z;
 }
main()
{
 int year,month,day;
 scanf("%d %d %d",&year,&month,&day);
 int z,i,sum=0;
 z=f(year);
 int a[12];
 a[0]=31;a[2]=31;a[3]=30;a[4]=31;a[5]=30;a[6]=31;a[7]=31;a[8]=30;a[9]=31;a[10]=30;a[11]=31;
 if(z==1) a[1]=29;
 else a[1]=28;
 for(i=0;i<month-1;i++)
 {
 sum=sum+a[i];
 }
 sum=sum+day;
 printf("%d",sum);
 getchar();
 getchar();
 return 0;
 }
int main(){
int y,m,d;
int f[22];
scanf ("%d %d %d",&y,&m,&d);
f[0]=31+d;
f[1]=60+d;
f[2]=91+d;
f[3]=121+d;
f[4]=152+d;
f[5]=182+d;
f[6]=213+d;
f[7]=244+d;
f[8]=274+d;
f[9]=305+d;
f[10]=335+d;
f[11]=31+d;
f[12]=59+d;
f[13]=90+d;
f[14]=120+d;
f[15]=151+d;
f[16]=181+d;
f[17]=212+d;
f[18]=243+d;
f[19]=273+d;
f[20]=304+d;
f[21]=334+d;
if((y%4==0&&y%100!=0)||y%400==0)
{switch(m){
case 1:printf("%d",d);break;
case 2:printf("%d",f[0]);break;
case 3:printf("%d",f[1]);break;
case 4:printf("%d",f[2]);break;
case 5:printf("%d",f[3]);break;
case 6:printf("%d",f[4]);break;
case 7:printf("%d",f[5]);break;
case 8:printf("%d",f[6]);break;
case 9:printf("%d",f[7]);break;
case 10:printf("%d",f[8]);break;
case 11:printf("%d",f[9]);break;
case 12:printf("%d",f[10]);break;}}
else
{switch(m){
case 1:printf("%d",d);break;
case 2:printf("%d",f[11]);break;
case 3:printf("%d",f[12]);break;
case 4:printf("%d",f[13]);break;
case 5:printf("%d",f[14]);break;
case 6:printf("%d",f[15]);break;
case 7:printf("%d",f[16]);break;
case 8:printf("%d",f[17]);break;
case 9:printf("%d",f[18]);break;
case 10:printf("%d",f[19]);break;
case 11:printf("%d",f[20]);break;
case 12:printf("%d",f[21]);break;}}
return 0;}
int main()
{
	int y,m,d,n;
	scanf("%d%d%d%d",&y,&m,&d,&n);
	if(y%4==0&&y%100!=0)
	{
		if(m==1)
			n=d;
		else if(m==2)
		    	n=31+d;
		else if(m<=8)
		{		
			n=(m-1)*30-1+m/2+d;
		
		}
		else
		{
		 if(m%2==0)
			n=(m-1)*30-1+m/2+d;
		   else 
			   n=(m-1)*30+m/2+d;
		}
	}
	if(y%400==0)
	{
       if(m==1)
			n=d;
	   else if(m==2)
	   	    	n=31+d;
       else if(m<=8)
	   {		
			n=(m-1)*30-1+m/2+d;
		
	   }
	   else
	   {
		 if(m%2==0)
			n=(m-1)*30-1+m/2+d;
		   else 
			   n=(m-1)*30+m/2+d;
	   }	
	}
	else
	{

       if(m==1)
			n=d;
	   else if(m==2)
	   	    	n=31+d;
       else if(m<=8)
	   {		
			n=(m-1)*30-2+m/2+d;
		
	   }
	   else
	   {	
		   if(m%2==0)
			n=(m-1)*30-2+m/2+d;
		   else 
			   n=(m-1)*30-1+m/2+d;
	   }
	}
	printf("%d",n);
	return 0;
}
int main()
{
	int year[10],mon[10],date[10],day[12],i,j,sum[10];
	for(i=0;i<=4;i++)
	scanf("%d %d %d",&year[i],&mon[i],&date[i]);
	for(i=0;i<=4;i++)
	{sum[i]=0;
	day[0]=31;
	if(((year[i]%4==0)&&(year[i]%100!=0))||(year[i]%400==0))day[1]=29;
    else day[1]=28;
	day[2]=31;
    day[3]=30;
	day[4]=31;
	day[5]=30;
	day[6]=31;
	day[7]=31;
	day[8]=30;
	day[9]=31;
	day[10]=30;
	day[11]=31;
	for(j=0;j<=mon[i]-2;j++)sum[i]=sum[i]+day[j];
	sum[i]=sum[i]+date[i];
	printf("%d\n",sum[i]);}
	return 0;
}
int main(int argc, char* argv[])
{
	int x,y,m,d;
	scanf("%d %d %d",&y,&m,&d);
	if(y%4==0||y%400==0)
    {
	switch(m)
	{
	    case 1:x=d;break;
		case 2:x=31+d;break;
		case 3:x=31+29+d;break;
		case 4:x=31+29+31+d;break;
		case 5:x=31+29+31+30+d;break;
		case 6:x=31+29+31+30+31+d;break;
		case 7:x=31+29+31+30+31+30+d;break;
		case 8:x=31+29+31+30+31+30+31+d;break;
		case 9:x=31+29+31+30+31+30+31+31+d;break;
		case 10:x=31+29+31+30+31+30+31+31+30+d;break;
		case 11:x=31+29+31+30+31+30+31+31+30+31+d;break;
		case 12:x=31+29+31+30+31+30+31+31+30+31+30+d;break;
	}
	}
	else
	{
    switch(m)
	{
	    case 1:x=d;break;
		case 2:x=31+d;break;
		case 3:x=31+28+d;break;
		case 4:x=31+28+31+d;break;
		case 5:x=31+28+31+30+d;break;
		case 6:x=31+28+31+30+31+d;break;
		case 7:x=31+28+31+30+31+30+d;break;
		case 8:x=31+28+31+30+31+30+31+d;break;
		case 9:x=31+28+31+30+31+30+31+31+d;break;
		case 10:x=31+28+31+30+31+30+31+31+30+d;break;
		case 11:x=31+28+31+30+31+30+31+31+30+31+d;break;
		case 12:x=31+28+31+30+31+30+31+31+30+31+30+d;break;
	}  
	}
	printf("%d\n",x);
	return 0;
}
int main()
{
	int j,total=0;
	int year,month,day;
		scanf("%d%d%d",&year,&month,&day);
		for(j=1;j<month;j++)
		{
			if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
				total=total+31;
			if(j==4||j==6||j==9||j==11)
				total=total+30;
			if(j==2)
			{
				if((year%4==0&&year%100!=0)||year%400==0)
					total=total+29;
				else
					total=total+28;
			}
		}
			total=total+day;
			printf("%d\n",total);
			return 0;
		
}
int main()
{
    int year, month, date, leap, num = 0;
    int mon[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
    scanf("%d %d %d", &year, &month, &date);

    if (year%100 == 0){
        if (year%400 == 0) leap = 1;
        else leap = 0;
    }
    else {
        if (year%4 == 0) leap = 1;
        else leap = 0;
    }

    int i;
    switch(leap)
    {
        case 1: for ( i = 0; i < month - 1; i++ ){
                    num = num + mon[i];
                }
                if ( month >= 3 ) num = num + date + 1;
                else num = num + date;
                break;
        case 0: for ( i = 0; i < month - 1; i++ ){
                    num = num + mon[i];
                }
                num = num + date;
    }

    printf("%d", num);

    return 0;
}
int main ( )
{
	int nian,yue,ri,tian,i=1;
	for (;i<=5;i=i+1)
	{
	scanf("%d %d %d\n",&nian,&yue,&ri);
	if (nian%4==0&&nian%100!=0||nian%100==0&&nian%400==0)
	{
		switch (yue)
	{
		case 1:tian=0;break;
		case 2:tian=31;break;
        case 3:tian=60;break;
		case 4:tian=91;break;
		case 5:tian=121;break;
		case 6:tian=152;break;
		case 7:tian=182;break;
		case 8:tian=213;break;
		case 9:tian=244;break;
		case 10:tian=274;break;
		case 11:tian=305;break;
		case 12:tian=335;break;
	}
	}
	else 
	{
		switch (yue)
	{
		case 1:tian=0;break;
		case 2:tian=31;break;
        case 3:tian=59;break;
		case 4:tian=90;break;
		case 5:tian=120;break;
		case 6:tian=151;break;
		case 7:tian=181;break;
		case 8:tian=212;break;
		case 9:tian=243;break;
		case 10:tian=273;break;
		case 11:tian=304;break;
		case 12:tian=334;break;
	}
	}
	tian=tian+ri;
	printf("%d\n",tian);
	}
         return 0;
}
int main()
{
	   int d[12]={0};
       int a,b,c,i,sum=0;
	   int run(int x);
	   scanf("%d%d%d",&a,&b,&c);
	   for(i=1;i<b;i++)
	   {
           if((i==1)||(i==3)||(i==5)||(i==7)||(i==8)||(i==10))
		   {
			   d[i]=31;
			   sum+=d[i];
		   }
	       else if((i==4)||(i==6)||(i==9)||(i==11))
		   {
			   d[i]=30;
			   sum+=d[i];
		   }
	       else 
		   {
		       if(run(a)==1)d[i]=29;
		       else d[i]=28;
			   sum+=d[i];
		   }
	   }
	   sum+=c;
	   printf("%d\n",sum);
}
int run(int x)
{
	int z;
	if((x%400==0)||((x%100!=0)&&(x%4==0)))
		z=1;
	return z;
}
/* Note:Your choice is C IDE */
main()
{
	int i,a[20],b[20],c[20],x,day;
	for(i=1;i<=5;i++)
	{
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
	}
	for(i=1;i<=5;i++)
	{
		if(a[i]%4==0&&a[i]%100!=0||a[i]%400==0)
		{
			if(b[i]==1)day=c[i];
			else if(b[i]==2)day=c[i]+31;
			else if(b[i]==3)day=c[i]+31+29;
			else if(b[i]==4)day=c[i]+31+29+31;
			else if(b[i]==5)day=c[i]+31+29+31+30;
			else if(b[i]==6)day=c[i]+31+29+31+30+31;
			else if(b[i]==7)day=c[i]+31+29+31+30+31+30;
			else if(b[i]==8)day=c[i]+31+29+31+30+31+30+31;
			else if(b[i]==9)day=c[i]+31+29+31+30+31+30+31+31;
			else if(b[i]==10)day=c[i]+31+29+31+30+31+30+31+31+30;
			else if(b[i]==11)day=c[i]+31+29+31+30+31+30+31+31+30+31;
			else if(b[i]==12)day=c[i]+31+29+31+30+31+30+31+31+30+31+30;
		}
		else
		{ 
			if(b[i]==1)day=c[i];
			else if(b[i]==2)day=c[i]+31;
			else if(b[i]==3)day=c[i]+31+28;
			else if(b[i]==4)day=c[i]+31+28+31;
			else if(b[i]==5)day=c[i]+31+28+31+30;
			else if(b[i]==6)day=c[i]+31+28+31+30+31;
			else if(b[i]==7)day=c[i]+31+28+31+30+31+30;
			else if(b[i]==8)day=c[i]+31+28+31+30+31+30+31;
			else if(b[i]==9)day=c[i]+31+28+31+30+31+30+31+31;
			else if(b[i]==10)day=c[i]+31+28+31+30+31+30+31+31+30;
			else if(b[i]==11)day=c[i]+31+28+31+30+31+30+31+31+30+31;
			else if(b[i]==12)day=c[i]+31+28+31+30+31+30+31+31+30+31+30;
		}
		printf("%d\n",day);
	}
	
		
    
}
int main()
{
    int days[]={0,31,28,31,30,31,30,31,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=c+days[i];
	printf("%d\n",c);
	return 0;
}
main()
{
      int q1,q2,q3,k=0;
      scanf("%d %d %d",&q1,&q2,&q3);
      if((q1%4==0&&q1&100!=0)||q1%400==0) k++;
      int a[15],b[16];
      if(k==0) a[2]=28;else a[2]=29;
      a[1]=31;a[3]=31;a[4]=30;a[5]=31;a[6]=30;
      a[7]=31;a[8]=31;a[9]=30;a[10]=31;a[11]=30;
      a[12]=31;b[1]=0;
       for(int i=2;i<=12;i++)
       b[i]=b[i-1]+a[i-1];
       printf("%d",b[q2]+q3);
       getchar();getchar();
      }
int main()
{
	int a,b,c,s;
	scanf("%d%d%d",&a,&b,&c);
	switch(b){
	case 1:
		s=c;
		break;
	case 2:
		s=c+31;
		break;
	case 3:
		s=c+31+28;
		break;
	case 4:
		s=c+31+28+31;
		break;
	case 5:
		s=c+31+28+31+30;
		break;
	case 6:
		s=c+31+28+31+30+31;
		break;
	case 7:
		s=c+31+28+31+30+31+30;
		break;
	case 8:
		s=c+31+28+31+30+31+30+31;
		break;
	case 9:
        s=c+31+28+31+30+31+30+31+31;
		break;
	case 10:
		s=c+31+28+31+30+31+30+31+31+30;
		break;
	case 11:
		s=c+31+28+31+30+31+30+31+31+30+31;
		break;
	case 12:
		s=c+31+28+31+30+31+30+31+31+30+31+30;
		break;
	}
	if((a%4==0&&a%100!=0||a%400==0)&&(b>2))
		s=s+1;
	printf("%d",s);
		return 0;
}
int main()
{
   int y,m,d,i,number=0;
   cin>>y>>m>>d;
   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};
  if(y%4==0&&y%100!=0||y%400==0)
   {
      for(i=1;i<=m-1;i++)
        number=number+b[i-1];
      number=number+d;
}
else
{
      for(i=1;i<=m-1;i++)
        number=number+a[i-1];
      number=number+d;
}
cout<<number<<endl;
return 0;
}
int main(int argc, char* argv[])
{
	int year,month,day,n,k,m2;
	scanf("%d %d %d",&year,&month,&day);
	if(year%4==0&&year%100!=0||year%400==0)
      m2=29;
	else m2=28;
    k=m2+31; 
    switch(month)
	{
	case 1:n=day;
		break;
    case 2:n=day+31;
		break;
	case 3:n=k+day;
		break;
	case 4:n=k+31+day;
		break;
	case 5:n=31+k+30+day;
		break;
	case 6:n=k+31+30+31+day;
		break;
	case 7:n=k+31+30+31+30+day;
		break;
	case 8:	n=k+31+30+31+30+31+day;
		break;
	case 9:n=k+31+30+31+30+31+31+day;
		break;
	case 10:n=k+31+30+31+30+31+31+30+day;
		break;
	case 11:n=k+31+30+31+30+31+31+30+31+day;
		break;
	case 12:n=k+31+30+31+30+31+31+30+31+30+day;
		break;
	}
 	printf("%d",n);
	return 0;
}
int main ()
{
 int a,b,c;
 scanf("%d%d%d",&a,&b,&c);
 int d=c+31;
 int e=c+60;
 int f=c+91;
 int g=c+121;
 int h=c+152;
 int i=c+182;
 int j=c+213;
 int k=c+244;
 int l=c+274;
 int m=c+305;
 int n=c+335;
 int o=c+59;
 int p=c+90;
 int q=c+120;
 int r=c+151;
 int s=c+181;
 int t=c+212;
 int u=c+243;
 int v=c+273;
 int w=c+304;
 int x=c+334;
 if (b==1)
	 printf("%d\n",c);
 else if (b==2)
	 printf("%d\n",d); 
 if(b>2&&((a%4==0&&a%100!=0)||(a%400==0)))
 {if(b==3)
 printf("%d\n",e);
 else if(b==4)
 printf("%d\n",f);
  else if(b==5)
 printf("%d\n",g);
 else if(b==6)
 printf("%d\n",h);
 else if(b==7)
 printf("%d\n",i);
 else if(b==8)
 printf("%d\n",j);
 else if(b==9)
 printf("%d\n",k);
 else if(b==10)
printf("%d\n",l);
 else if(b==11)
printf("%d\n",m);
 else if(b==12)
printf("%d\n",n);
 } 
 else if(b>2&&((a%4!=0)||(a%100==0&&a%400!=0)))
 {if(b==3)
 printf("%d\n",o);
 else if(b==4)
printf("%d\n",p);
else if(b==5)
printf("%d\n",q);
else if(b==6)
printf("%d\n",r);
else if(b==7)
printf("%d\n",s);
else if(b==8)
printf("%d\n",t);
else if(b==9)
printf("%d\n",u);
else if(b==10)
printf("%d\n",v);
else if(b==11)
printf("%d\n",w);
else if(b==12)
printf("%d\n",x);

 }
 return 0;
}
int main()
{
	int year,mon,g,i,e=0,day;
    int montha[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int monthb[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};

	scanf("%d%d%d",&year,&mon,&g);

	for(i=0;i<mon;i++)
    {
		if(year%4==0)
		{
	    	if(year%100==0&&year%400!=0)
			{
	    	e=e+montha[i];
			
		    day=e+g;
			}
	       else 
		   {
	        e=e+monthb[i];
	    	day=e+g;
		   }
		}
        if(year%4!=0)
		{
		  e=e+montha[i];
		  day=e+g;
		}
	}
	   printf("%d",day);
	   return 0;
}
int main()
{
    int y,m,d,sum,jan=31,feb,mar=31,apr=30,may=31,jun=30,jul=31,aug=31,sep=30,oct=31,nov=30;
    scanf("%d%d%d",&y,&m,&d);
    if((y%400==0)||((y%4==0)&&(y%100!=0)))
    feb=29;
    else feb=28;
    switch (m)
    {
    case 1:sum=d;break;
    case 2:sum=jan+d;break;
    case 3:sum=jan+feb+d;break;
    case 4:sum=jan+feb+mar+d;break;
    case 5:sum=jan+feb+mar+apr+d;break;
    case 6:sum=jan+feb+mar+apr+may+d;break;
    case 7:sum=jan+feb+mar+apr+may+jun+d;break;
    case 8:sum=jan+feb+mar+apr+may+jun+jul+d;break;
    case 9:sum=jan+feb+mar+apr+may+jun+jul+aug+d;break;
    case 10:sum=jan+feb+mar+apr+may+jun+jul+aug+sep+d;break;
    case 11:sum=jan+feb+mar+apr+may+jun+jul+aug+sep+oct+d;break;
    case 12:sum=jan+feb+mar+apr+may+jun+jul+aug+sep+oct+nov+d;break;
    }
    printf("%d",sum);
    return 0;
}
int map[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
	int year,month,day;
	int i,sum=0;
	scanf("%d%d%d",&year,&month,&day);
	if(year%4==0&&year%100!=0||year%400==0)
		map[2]=29;
	if(month==1)
		sum=day;
	else
	{
		for(i=1;i<month;i++)
			sum=sum+map[i];
		sum=sum+day;
	}
	printf("%d",sum);
	return 0;
}
int main()
{
	int a[100];
	int i,y,m,d,s;

	scanf("%d%d%d",&y,&m,&d);
    if (( (y%4==0) && (y%100>0) )||(y%400==0) ) a[2]=29;
	  else a[2]=28;
	
	a[1]=31;a[3]=31;a[5]=31;a[7]=31;a[8]=31;a[10]=31;a[12]=31;
	a[4]=30;a[6]=30;a[9]=30;a[11]=30;
	s=0;
	for (i=1;i<m;i++)
	  s=s+a[i];	
	s=s+d;
	printf("%d\n",s);
	return 0;
}
int main()
{
	int y,m,d,sum=0;
	int i=0;
	int n[12];
	sum=0;
	scanf("%d%d%d",&y,&m,&d);

	if((y % 4 ==0) && (y % 100 != 0))
	{   n[0] = 31;
	    n[1] = 29;
		n[2] = 31; 
		n[3] = 30;
		n[4] = 31;
		n[5] = 30;
		n[6] = 31;
		n[7] = 31;
		n[8] = 30;
		n[9] = 31;
		n[10] = 30;
		n[11] = 31;
	    for(i = 0; i < m-1;i++)
		{  
			sum += n[i];
		}
		sum += d;
		printf("%d\n",sum);
	}

	if((y % 4 == 0) && (y % 100 == 0) && (y % 400 != 0))
	{
		n[0] = 31;
	    n[1] = 28;
        n[2] = 31; 
	    n[3] = 30;
	    n[4] = 31;
	    n[5] = 30;
	    n[6] = 31;
	    n[7] = 31;
	    n[8] = 30;
		n[9] = 31;
		n[10] = 30;
		n[11] = 31;
	   for(i = 0; i < m - 1;i++)
		{
			sum += n[i];
		}
		sum += d;
		printf("%d\n",sum);
	}
    if((y % 4 == 0) && (y % 100 == 0) && (y % 400 == 0))
	{ 
		n[0] = 31;
	    n[1] = 29;
		n[2] = 31; 
		n[3] = 30;
		n[4] = 31;
		n[5] = 30;
		n[6] = 31;
		n[7] = 31;
		n[8] = 30;
		n[9] = 31;
		n[10] = 30;
		n[11] = 31;
	   for(i = 0; i < m - 1;i++)
		{  sum += n[i];
		}
		sum += d;
		printf("%d\n",sum);
	}

	if(y % 4 != 0)
	{  
		n[0] = 31;
	    n[1] = 28;
		n[2] = 31; 
		n[3] = 30;
		n[4] = 31;
		n[5] = 30;
		n[6] = 31;
		n[7] = 31;
		n[8] = 30;
		n[9] = 31;
		n[10] = 30;
		n[11] = 31;
	   for(i = 0; i < m - 1;i++)
		{  sum = sum + n[i];
		}
		sum = sum + d;
		printf("%d\n",sum);
	}
	return 0;
}
int main()
{
	int y,m,d,x=0,i;
	scanf("%d%d%d",&y,&m,&d);
	if(y%4==0&&y%100!=0||y%400==0)
	{
		for(i=1;i<m;i++)
		{
			if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
				x=x+31;
			else if(i==4||i==6||i==9||i==11)
				x=x+30;
			else
				x=x+29;
		}
		x=x+d;
	}
	else
	{
		for(i=1;i<m;i++)
		{
			if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
				x=x+31;
			else if(i==4||i==6||i==9||i==11)
				x=x+30;
			else
				x=x+28;
		}
		x=x+d;
	}
	printf("%d\n",x);
	return 0;
}
main ()
{
     int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
     int b,c,d,i;
     scanf("%d %d %d",&b,&c,&d);
     if ((b%4==0 && b%100!=0) || (b%100==0 && b%400==0))
     {
                 a[2]=29;
     }
     for (i=1;i<c;i++)
     {
         d=d+a[i];
     }
     printf("%d",d);
}
int main()
{
    int test(int n);
    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};
    int y,m,d,s,i;
    scanf("%d%d%d",&y,&m,&d);
    if(test(y)==1)//??? 
    {
       s=d;
       for(i=0;i<m;i++)
       s=s+b[i];
    }
    else
    {
       s=d;
       for(i=0;i<m;i++)
       s=s+a[i];
    }
    printf("%d",s);
    getchar();
    getchar();
}
int test(int n)
{
    if(n%400==0)n=1;
    else
       if(n%100!=0&&n%4==0)
       n=1;
       else  n=0;
       return(n);
}
int leap(int n){
	int leap=0;
	if(n%400==0 || n%100!=0 && n%4==0) leap=1;
	return(leap);
}

int main(){
	int year, month, day, th=0, a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d %d %d", &year, &month, &day);
	if(leap(year)==1) a[2]=29;
	for(int i=0; i<month; i++) th=th+a[i];
	th=th+day;
	printf("%d", th);
	return(0);
}
void main()
{
	int y,m,d,x;
	scanf("%d %d %d",&y,&m,&d);
	if(y%4!=0||(y%100==0&&y%400!=0))
	{
		switch(m)
		{
			case 1:x=d;break;
			case 2:x=31+d;break;
			case 3:x=31+28+d;break;
			case 4:x=31+28+31+d;break;
			case 5:x=31+28+31+30+d;break;
			case 6:x=31+28+31+30+31+d;break;
			case 7:x=31+28+31+30+31+30+d;break;
			case 8:x=31+28+31+30+31+30+31+d;break;
			case 9:x=31+28+31+30+31+30+31+31+d;break;
			case 10:x=31+28+31+30+31+30+31+31+30+d;break;
			case 11:x=31+28+31+30+31+30+31+31+30+31+d;break;
			case 12:x=31+28+31+30+31+30+31+31+30+31+30+d;break;
		}
		printf("%d",x);
	}
	if((y%4==0&&y%100!=0)||y%400==0)
	{
		switch(m)
		{
			case 1:x=d;break;
			case 2:x=31+d;break;
			case 3:x=31+29+d;break;
			case 4:x=31+29+31+d;break;
			case 5:x=31+29+31+30+d;break;
			case 6:x=31+29+31+30+31+d;break;
			case 7:x=31+29+31+30+31+30+d;break;
			case 8:x=31+29+31+30+31+30+31+d;break;
			case 9:x=31+29+31+30+31+30+31+31+d;break;
			case 10:x=31+29+31+30+31+30+31+31+30+d;break;
			case 11:x=31+29+31+30+31+30+31+31+30+31+d;break;
			case 12:x=31+29+31+30+31+30+31+31+30+31+30+d;break;
		}
		printf("%d",x);
	}

}
main()
{
 int y,m,d,i;
 int a[13];
  a[0]=0;
 int sum=0;
 scanf("%d %d %d",&y,&m,&d);
  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(y%400==0||(y%4==0&&y%100!=0))
  a[2]=29;
  else
  a[2]=28;
 for(i=1;i<m;i++)
  sum=sum+a[i];
  sum=sum+d;
 printf("%d",sum);
 getchar();
}
int main()
{
	int y,m,d,sum;
	scanf("%d%d%d",&y,&m,&d);
	if(m==1)
		sum=d;
	if(m==2)
		sum=31+d;
	if(y%4==0&&y%100!=0||y%400==0)
	{
		if(m==3)
			sum=31+29+d;
		if(m==4)
			sum=31+29+31+d;
		if(m==5)
			sum=31+29+31+30+d;
		if(m==6)
            sum=31+29+31+30+31+d;
		if(m==7)
			sum=31+29+31+30+31+30+d;
		if(m==8)
			sum=31+29+31+30+31+30+31+d;
		if(m==9)
			sum=31+29+31+30+31+30+31+31+d;
		if(m==10)
			sum=31+29+31+30+31+30+31+31+30+d;
		if(m==11)
			sum=31+29+31+30+31+30+31+31+30+31+d;
		if(m==12)
			sum=31+29+31+30+31+30+31+31+30+31+30+d;
	}
	else
	{if(m==3)
			sum=31+28+d;
		if(m==4)
			sum=31+28+31+d;
		if(m==5)
			sum=31+28+31+30+d;
		if(m==6)
            sum=31+28+31+30+31+d;
		if(m==7)
			sum=31+28+31+30+31+30+d;
		if(m==8)
			sum=31+28+31+30+31+30+31+d;
		if(m==9)
			sum=31+28+31+30+31+30+31+31+d;
		if(m==10)
			sum=31+28+31+30+31+30+31+31+30+d;
		if(m==11)
			sum=31+28+31+30+31+30+31+31+30+31+d;
		if(m==12)
			sum=31+28+31+30+31+30+31+31+30+31+30+d;
	}
	printf("%d\n",sum);
	return 0;
}
int f1(int n)
{
    int i,m;
    for(i=1,m=0;i<n;i++)
    {
        if(i==1)
        m=m+31;
        if(i==2)
        m=m+28;
        if(i==3)
        m=m+31;
        if(i==4)
        m=m+30;
        if(i==5)
        m=m+31;
        if(i==6)
        m=m+30;
        if(i==7)
        m=m+31;
        if(i==8)
        m=m+31;
        if(i==9)
        m=m+30;
        if(i==10)
        m=m+31;
        if(i==11)
        m=m+30;
        if(i==12)
        m=m+31;
    }
    return m;
}
int f2(int n)
{
    int m,i;
    for(i=1,m=0;i<n;i++)
    {
        if(i==1)
        m=m+31;
        if(i==2)
        m=m+29;
        if(i==3)
        m=m+31;
        if(i==4)
        m=m+30;
        if(i==5)
        m=m+31;
        if(i==6)
        m=m+30;
        if(i==7)
        m=m+31;
        if(i==8)
        m=m+31;
        if(i==9)
        m=m+30;
        if(i==10)
        m=m+31;
        if(i==11)
        m=m+30;
        if(i==12)
        m=m+31;
    }
    return m;
}
int main()
{
    int y,mon,d,a;
    scanf("%d%d%d",&y,&mon,&d);
    if(y%4!=0||(y%100==0&&y%400!=0))
    {
        a=f1(mon)+d;
        printf("%d",a);
    }
    else
    {
        a=f2(mon)+d;
        printf("%d",a);
    }
    getchar();
    getchar();
}
int main(void)
{
	int ye, mo, da, i, sum = 0;
	int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	scanf("%d%d%d", &ye, &mo, &da);

	for (i = 1; i < mo; i++)
	{
		sum = sum + mon[i];
	}
	if (((ye % 400 == 0) && mo > 2) || ((ye % 4 == 0) && (ye % 100 != 0)) && mo > 2)
	{
		sum = sum + da + 1;
	}
	else
	{
		sum = sum + da;
	}

	printf("%d", sum);

	return 0;
}
int f(int n)
{
	cin >> n;
	if (n%100==0)
	{
		if (n%400==0)
		return 1;
		else return 0;
	}
	else  if(n%4==0)
		return 1;
	else 
	 return 0;
}

int main()
{
	int y,m,d;
	cin >> y>>m>>d;
	int t=0,i;
	for(i=1;i<m;i++)
	{
		if (i==1||i==5||i==3||i==7||i==8||i==10)
		t=t+31;
		else if (i==2)
		t=t+28;
		else if (i==4 || i==6 || i==9 ||i==11)
		t=t+30;
	}
	t=t+d;
	if (f(y)==1 && m>2)
	t=t+1;
	cout <<t <<endl;
	return 0;
}