semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a,b,c,m;
	scanf("%d %d %d",&a,&b,&c);
	if((a%4==0&&a%100!=0)||(a%400==0))
	{	if(b==1)
			printf("%d",c);
		if(b==2)
		{	m=31+c;
		printf("%d",m);}
		if(b==3)
		{	m=31+29+c;
		printf("%d",m);}
		if(b==4)
		{	m=31+29+31+c;
		printf("%d",m);}
		if(b==5)
		{	m=31+29+31+30+c;
		printf("%d",m);}
		if(b==6)
		{	m=31+29+31+30+31+c;
		printf("%d",m);}
		if(b==7)
		{m=31+29+31+30+31+30+c;
		printf("%d",m);}
		if(b==8)
		{	m=31+29+31+30+31+30+31+c;
		printf("%d",m);}
		if(b==9)
		{m=31+29+31+30+31+30+31+31+c;
		printf("%d",m);}
		if(b==10)
		{m=31+29+31+30+31+30+31+31+30+c;
		printf("%d",m);}
		if(b==11)
		{m=31+29+31+30+31+30+31+31+30+31+c;
		printf("%d",m);}
		if(b==12)
		{m=31+29+31+30+31+30+31+31+30+31+30+c;
		printf("%d",m);}
	}
	    else
		{if(b==1)
			printf("%d",c);


		if(b==2)
		{m=31+c;
		printf("%d",m);}
		if(b==3)
		{	m=31+28+c;
		printf("%d",m);}
		if(b==4)
		{m=31+28+31+c;
		printf("%d",m);}
		if(b==5)
		{m=31+28+31+30+c;
		printf("%d",m);}
		if(b==6)
		{m=31+28+31+30+31+c;
		printf("%d",m);}
		if(b==7)
		{	m=31+28+31+30+31+30+c;
		printf("%d",m);}
		if(b==8)
		{	m=31+28+31+30+31+30+31+c;
		printf("%d",m);}
		if(b==9)
		{m=31+28+31+30+31+30+31+31+c;
		printf("%d",m);}
		if(b==10)
		{	m=31+28+31+30+31+30+31+31+30+c;
		printf("%d",m);}
		if(b==11)
		{m=31+28+31+30+31+30+31+31+30+31+c;
		printf("%d",m);}
		if(b==12)
		{m=31+28+31+30+31+30+31+31+30+31+30+c;
		printf("%d",m);}}
	return 0;
}
void main()
{
	int a,b,c,d,i;
	int j=1;
	while(j<=5)
	{
	scanf("%d %d %d",&a,&b,&c);
	i=1;
	d=0;
	while(i<b)
	{
		if (i==1||i==3||i==5||i==7||i==8||i==10)
			d=d+31;
		else if (i==2)
		{
			if (a%4==0&&a%100!=0||a%400==0)
				d=d+29;
			else d=d+28;
		}
		else if (i==4||i==6||i==9||i==11) d=d+30;
		i=i+1;
	}
	d=d+c;
	printf("%d\n",d);
	j++;
	}
}
void main()
{
  int year,month,day,leap,sum;
  scanf("%d %d %d",&year,&month,&day);
  if(year%4!=0) leap=0;
  if(year%4==0)
  {
	  if(year%100!=0)  leap=1;
	  if(year%100==0&&year%400==0)  leap=1;
	  else leap=0;
  }
  if(leap==1)
  {
	  switch(month)
	  {
	  case 1: sum=day;break;
      case 2: sum=31+day;break;
	  case 3: sum=31+29+day;break;
	  case 4: sum=31+29+31+day;break;
	  case 5: sum=31+29+31+30+day;break;
	  case 6: sum=31+29+31+30+31+day;break;
	  case 7: sum=31+29+31+30+31+30+day;break;
	  case 8: sum=31+29+31+30+31+30+31+day;break;
	  case 9: sum=31+29+31+30+31+30+31+31+day;break;
	  case 10: sum=31+29+31+30+31+30+31+31+30+day;break;
	  case 11: sum=31+29+31+30+31+30+31+31+30+31+day;break;
	  case 12: sum=31+29+31+30+31+30+31+31+30+31+30+day;break; 
	  }
  }
  if(leap==0)
  {	 
	  switch(month)
	  {
	  case 1: sum=day;break;
      case 2: sum=31+day;break;
	  case 3: sum=31+28+day;break;
	  case 4: sum=31+28+31+day;break;
	  case 5: sum=31+28+31+30+day;break;
	  case 6: sum=31+28+31+30+31+day;break;
	  case 7: sum=31+28+31+30+31+30+day;break;
	  case 8: sum=31+28+31+30+31+30+31+day;break;
	  case 9: sum=31+28+31+30+31+30+31+31+day;break;
	  case 10: sum=31+28+31+30+31+30+31+31+30+day;break;
	  case 11: sum=31+28+31+30+31+30+31+31+30+31+day;break;
	  case 12: sum=31+28+31+30+31+30+31+31+30+31+30+day;break; 
	  }
  }
  printf("%d",sum);
}
int main()
{
	int n,m,d,i,j,counter=0,month1[12]={31,28,31,30,31,30,31,31,30,31,30,31},month2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	cin>>n>>m>>d;
	if((n%4==0&&n%100!=0)||(n%400==0))
	{
		for(i=0;i<m-1;i++)
			counter+=month2[i];
		counter+=d;
		cout<<counter<<endl;
	}
	else 
	{
		for(i=0;i<m-1;i++)
			counter+=month1[i];
		counter+=d;
		cout<<counter<<endl;
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int year[5],mon[5],day[5],sum=0,i,j;
	for (j=0;j<5;j++)
	scanf("%d%d%d",&year[j],&mon[j],&day[j]);
	for (j=0;j<5;j++)
	{
		if (year[j]%400==0) a[1]=29;
		else if (year[j]%4==0)
		{
			if (year[j]%100==0)
				a[1]=28;
			else a[1]=29;
		}
		for (i=0;i<=(mon[j]-2);i++)
			sum=sum+a[i];
		sum=sum+day[j];
		printf("%d\n",sum);
		sum=0;
	}
	return 0;
}
main()
{
 int year;
 int month;
 int day;
 int z;
 z=0;
 scanf("%d %d %d",&year,&month,&day);
 int m[12];
 m[0]=31;
 if(year%4==0)
 {
  m[1]=29;
  if(year%100==0)
  m[1]=28;
  if(year%400==0)
  m[1]=29;
 }
 else
 m[1]=28;
 m[2]=31;
 m[3]=30;
 m[4]=31;
 m[5]=30;
 m[6]=31;
 m[7]=31;
 m[8]=30;
 m[9]=31;
 m[10]=30;
 m[11]=31;
 int i;
 for(i=0;i<month-1;i++)
 z=z+m[i];
 printf("%d\n",z+day);
 getchar();
 getchar();
 getchar();
 getchar();
}
int main ()
{
	int y,m,d,sum=0;
    scanf("%d%d%d",&y,&m,&d);
	for(int i=1;i<m;i++)
	{
		if
			(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{sum+=31;
	}
	else if
		(i==4||i==6||i==9||i==11)
	{
		sum+=30;
	}
		if(i==2&&y%400==0||y%4==0&&y%100!=0)
		{
			sum=sum+29;}
		else if (i==2)
			sum+=28;
	}
	sum=sum+d;
	printf("%d",sum);
	return 0;
}
int main()
{
  int a[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 y,m,i,d,s=0;
  scanf("%d %d %d",&y,&m,&d);
  if(y%400==0||(y%100!=0&&y%4==0))
   {
    for(i=0;i<m;i++)
      s+=a[1][i];
      s+=d;
   }
  else
   {
     for(i=0;i<m;i++)
      s+=a[0][i];
      s+=d;
    }
  printf("%d",s);
  return 0;
}
int main()
{
    int i,year,month,date,num;
    for(i=1;i<=5;i++)
{	
         scanf("%d %d %d",&year,&month,&date);
	switch(month)
	{
	case 1:num=0;break;
	case 2:num=31;break;
         case 3:num=59;break;
	case 4:num=90;break;
	case 5:num=120;break;
	case 6:num=151;break;
	case 7:num=181;break;
	case 8:num=212;break;
	case 9:num=243;break;
	case 10:num=273;break;
	case 11:num=304;break;
	case 12:num=334;break;
	}
	if ((year%4==0&&year%100!=0||year%400==0)&&month>2) num+=1;
	num+=date;
	printf("%d\n",num);
}	

	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))
{if(b==1)
{d=c;}
else if(b==2)
{d=31+c;}
else if
(b==3)
{d=60+c;}
else if(b==4)
{d=91+c;}
else if(b==5)
{d=121+c;}
else if(b==7)
{d=182+c;}
else if(b==8)
{d=213+c;}
else if(b==9)
{d=244+c;}
else if(b==10)
{d=274+c;}
else if(b==11)
{d=305+c;}
else if(b==12)
{d=335+c;}}
else 
{if(b==1){d=c;}
else if(b==2)
{d=31+c;}
else if(b==3)
{d=59+c;}
else if(b==4)
{d=90+c;}else if(b==5)
{d=120+c;}else if(b==6)
{d=151+c;}else if(b==7)
{d=181+c;}else if(b==8)
{d=212+c;}else if(b==9)
{d=243+c;}else if(b==10)
{d=273+c;}else if(b==11)
{d=304+c;}else if(b==12)
{d=334+c;}}
printf("%d",d);
return 0;

}
int main()
{
	int year,month,day;
	scanf("%d%d%d",&year,&month,&day);
	int x;
	int Jan=1,feb=2,Mar=3,Apr=4,May=5,Jun=6;
	int Jul=7,Aug=8,Sep=9,Oct=10,Nov=11,Dec=12;
	int Feb;
	{
		if(year%4==0)
		{
			if(year%100==0)
			{
				if(year%400==0)
					Feb=29;
				else
					Feb=28;
			}
			else
				Feb=29;
		}
		else
			Feb=28;
	}
	if(month==Jan)
		x=day;
	if(month==feb)
		x=31+day;
	if(month==Mar)
		x=31+Feb+day;
	if(month==Apr)
		x=31+Feb+31+day;
	if(month==May)
		x=31+Feb+31+30+day;
	if(month==Jun)
		x=31+Feb+31+30+31+day;
	if(month==Jul)
		x=31+Feb+31+30+31+30+day;
	if(month==Aug)
		x=31+Feb+31+30+31+30+31+day;
	if(month==Sep)
		x=31+Feb+31+30+31+30+31+31+day;
	if(month==Oct)
		x=31+Feb+31+30+31+30+31+31+30+day;
	if(month==Nov)
		x=31+Feb+31+30+31+30+31+31+30+31+day;
	if(month==Dec)
		x=31+Feb+31+30+31+30+31+31+30+31+30+day;
	printf("%d\n",x);
	return 0;
}
int main()
{
   int y,m,d,a[12]={31,28,31,30,31,30,31,31,30,31,30,31},b[12]={0},i;
   cin>>y>>m>>d;
   if(y%4!=0||y%100==0&&y%400!=0)a[1]=28;
   else a[1]=29;
   for(i=1;i<12;i++)
   {
       b[0]=a[0];
       b[i]=b[i-1]+a[i];
   }
   if(m==1)cout<<d<<endl;
   else if(m!=1)cout<<b[m-2]+d<<endl;
   return 0;
}
/*?? - ??(10.1) ????	
??
??????????
????
?????????????a(0 < a < 3000)?
????
???????a??????Y?????N?
????
2006
????
N*/
int main()

{   int just(int y);


  
    int y, m ,d , t=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( just (y) == 1)
    {if(m == 1)
     t = 0;
     else
     for(int i = 0; i <= m-2 ; i ++)
     t+=b[i];
   
     } 
      else
    {if(m == 1)
     t = 0;
     else
     for(int i = 0; i <= m-2 ; i ++)
     t+=a[i];
   
     } 
     cout<<t+d;
 
     return 0;
     }
     
     
     int just(int y)
   { int m=0;
   
    if(y%4 == 0 && y%100!=0)
    {return 1;
    }
    if(y%400 == 0)
    {return 1;   }
     return 0;}
int main()
{
    int y,m,d,j;
    scanf("%d %d %d",&y,&m,&d);
    if(y%4==0)
    {
              if(y%100==0)
              {
                          if(y%400==0)
                          j=1;
                          else
                          j=0;
              }
              else
              j=1;
              
    }
    else
    j=0;
    if(j==1)
    {      switch(m)
           {case 1:printf("%d",d);break;
           case 2:printf("%d",d+31);break;
           case 3:printf("%d",d+60);break;
           case 4:printf("%d",d+91);break;
           case 5:printf("%d",d+121);break;
           case 6:printf("%d",d+152);break;
           case 7:printf("%d",d+182);break;
           case 8:printf("%d",d+213);break;
           case 9:printf("%d",d+244);break;
           case 10:printf("%d",d+274);break;
           case 11:printf("%d",d+305);break;
           case 12:printf("%d",d+335);break;
           }
} 


 
    if(j==0)
    {switch(m)
           {case 1:printf("%d",d);break;
           case 2:printf("%d",d+31);break;
           case 3:printf("%d",d+59);break;
           case 4:printf("%d",d+90);break;
           case 5:printf("%d",d+120);break;
           case 6:printf("%d",d+151);break;
           case 7:printf("%d",d+181);break;
           case 8:printf("%d",d+212);break;
           case 9:printf("%d",d+243);break;
           case 10:printf("%d",d+273);break;
           case 11:printf("%d",d+304);break;
           case 12:printf("%d",d+334);break;
           }
}
           
getchar();
getchar();
    
    

}
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;
 int z,i=0,sum=0;
 int a[12],b[12];
 scanf("%d %d %d",&year,&month,&day);
 z=f(year);
 if(z==1) 
 {int a[]={31,29,31,30,31,30,31,31,30,31,30,31};
 for(i=0;i<month-1;i++)
 {
 sum=sum+a[i];
 }
 }
 else 
 {
 int a[]={31,28,31,30,31,30,31,31,30,31,30,31};
 for(i=0;i<month-1;i++)
 {
 sum=sum+a[i];
 } 
}
 sum=sum+day;
 printf("%d",sum);
 getchar();
 getchar();
 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,sum=0;
	cin>>y>>m>>d;
	if((y%4==0 && y%100!=0) || y%400==0)
	{
		for(int i=m-2;i>=0;i--)
		{
			sum=sum+b[i];
		}
		cout<<sum+d;
	}
	else
	{
		for(int s=m-2;s>=0;s--)
		{
			sum=sum+a[s];
		}
		cout<<sum+d;
	}
	return 0;
}
int main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if((a%100!=0&&a%4==0)||(a%400==0))
    {
                                      if(b==1)
                                      printf("%d",c);
                                     else if(b==2)
                                      printf("%d",c+31);
                                      else if(b==3)
                                      printf("%d",c+60);
                                      else if(b==4)
                                      printf("%d",c+91);
                                       else if(b==5)
                                      printf("%d",c+121);
                                       else if(b==6)
                                      printf("%d",c+152);
                                       else if(b==7)
                                      printf("%d",c+182);
                                       else if(b==8)
                                      printf("%d",c+213);
                                       else if(b==9)
                                      printf("%d",c+244);
                                       else if(b==10)
                                      printf("%d",c+274);
                                       else if(b==11)
                                      printf("%d",c+305);
                                      else printf("%d",c+335);
    }
    else
    {
                                      if(b==1)
                                      printf("%d",c);
                                     else if(b==2)
                                      printf("%d",c+31);
                                      else if(b==3)
                                      printf("%d",c+59);
                                      else if(b==4)
                                      printf("%d",c+90);
                                       else if(b==5)
                                      printf("%d",c+120);
                                       else if(b==6)
                                      printf("%d",c+152);
                                       else if(b==7)
                                      printf("%d",c+181);
                                       else if(b==8)
                                      printf("%d",c+212);
                                       else if(b==9)
                                      printf("%d",c+243);
                                       else if(b==10)
                                      printf("%d",c+273);
                                       else if(b==11)
                                      printf("%d",c+304);
                                      else printf("%d",c+334);
    }
    getchar();
    getchar();
}
int judge(int);
int main()
{
	int year,month,day,i,j,total=0;
	cin>>year>>month>>day;
	for(i=1;i<=month-1;i++)
	{
		if(i==1 || i==3 || i==5 || i==7 || i==8 || i==10)
			total=total+31;
		else if(i==4 || i==6 || i==9 || i==11)
			total=total+30;
		else if(judge(year)==0 && i==2)
			total=total+28;
		else if(judge(year)==1 && i==2)
            total=total+29;
	}
	total=total+day;
	cout<<total<<endl;
	return 0;
}
int judge(int x)
{
	int y=0;
	if(x%4==0 && x%100!=0 || x%400==0)
		y=1;
	else
		y=0;
	return y;
}
int main() 
{ 
	int a,b,c,d,e;
	scanf("%d %d %d",&a,&b,&c);
	d=0;
    int days1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int days2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    if((a % 4 == 0 && a % 100 !=0 ) || a % 400 == 0)
	{
		for(e=0;e<b;e++)
		{
			d=d+days1[e];
		}
		d=d+c;
	}
	else 
	{
        for(e=0;e<b;e++)
		{
			d=d+days2[e];
		}
		d=d+c;
	}
	d=d-1;
	printf("%d",d);
}
int run(int a)
{
	if ( a%4==0 && a%100 !=0 || a%400==0)
	{
		return 1;
	}
	else
	{
		return 0;
	}
}

int main()
{
	int y,m,d;
	cin>>y>>m>>d;
	int isr = run(y);
	int p[13]= {0,31,28,31,30,31,30,31,31,30,31,30,31};
	int days= 0;
	for (int i = 1;i<m;i++)
	{
		days = days + p[i];
	}
	days = days + d;
	if (isr==1 && m>=3)
		days++;
	cout<<days;
}
int main ( )
{
	int year, month, day, num = 0, i, 
		a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> year >> month >> day;
	if((year % 400 == 0)||((year % 100 != 0)&&(year % 4 == 0)))/*???????*/
		a[1] = 29;
	else a[1] = 28;
	for(i = 0;i < month-1;i++)              /*??month-1???????*/
	{
		num += a[i];
	}
	num += day;                             /*???month?????*/
	cout << num <<endl;
	return 0;
}
int main()
{
	int a,b,c,i,n=0;
	scanf("%d %d %d",&a,&b,&c);
	int m[11]={31,0,31,30,31,30,31,31,30,31,30};
	if(a%4==0&&a%100!=0||a%100==0&&a%400==0)
		m[1]=29;
	else
		m[1]=28;
	if(b==1)
		n=c;
	else
	{
		for(i=0;i<b-1;i++)
			n=n+m[i];
		n=n+c;
	}
	printf("%d\n",n);
	return 0;
}
int main()
{
   int sum=0,year,month,day,a[32],i,n;
   scanf("%d%d%d",&year,&month,&day);
   a[0]=0;
   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(year%4==0&&year%200==0){a[2]=29;}
    else
    {a[2]=28;
    }
    for(i=0;i<month;i++)
    {
    	sum=sum+a[i];
    }
    n=sum+day;
    printf("%d",n);
    return 0;
}
void main()
{
   int i,a[5],m[5],d[5],c[5],t[5];
     for(i=0;i<5;i++)
	 {scanf("%d%d%d",&a[i],&m[i],&d[i]);
    if(((a[i]%4==0&&a[i]%100!=0)||a[i] %400==0)==1)
	{    
		switch(m[i])
		{				
                  case 1:c[i]=0;break;
                  case 2:c[i]=31;break;
                  case 3:c[i]=60;break;
                  case 4:c[i]=91;break;
                  case 5:c[i]=121;break;
                  case 6:c[i]=152;break;             
                  case 7:c[i]=182;break;
                  case 8:c[i]=213;break;
                  case 9:c[i]=244;break;
                  case 10:c[i]=274;break;
                  case 11:c[i]=305;break;
                  case 12:c[i]=335;break;
			}
	
    }
	else
	{
		switch(m[i])
		{
		    case 1:c[i]=0;break;
            case 2:c[i]=31;break;
            case 3:c[i]=59;break;
            case 4:c[i]=90;break;
            case 5:c[i]=120;break;
            case 6:c[i]=151;break;
            case 7:c[i]=181;break;
            case 8:c[i]=212;break;
            case 9:c[i]=243;break;
            case 10:c[i]=273;break;
            case 11:c[i]=304;break;
            case 12:c[i]=334;break;
		}
	}
	          t[i]=c[i]+d[i];
			printf("%d\n",t[i]);
}}
int main(int argc, char* argv[])
{
    int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int y,m,d,sum=0,i,h;
	scanf("%d%d%d",&y,&m,&d);
	if(y%4==0&&y%100!=0||y%400==0)
	{
		days[1]=29;
	}
	else
	{
		days[1]=28;
	}
	for(i=0;i<m-1;i++)
	{
		sum=sum+days[i];
	}
    h=sum+d;
	printf("%d",h);
	return 0;
}
int runnian(int y)
{
	scanf("%d",&y);
	if((y%4==0&&y%100!=0)||(y%100==0&&y%400==0))
	{
		y=366;
	}
	else 
	{
		y=365;
	}
	return y;
}
int main(int y,int m,int d)
{
	int i,n;
	n=0;
	scanf("%d%d%d",&y,&m,&d);
	for(i=1;i<m;i++)
	{
		if(i==1||i==3||i==5||i==7|i==8||i==10||i==12)
		{
			n+=31;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			n+=30;
		}
		else if(i==2)
		{
			if(runnian(y)==366)
			{
				n+=29;
			}
			else
			{
				n+=28;
			}
		}
	}
	n+=d;
	printf("%d\n",n);
	return 0;
}
int leapyear(int year)
   {
    if ((year%4==0)&&(year%100!=0)||(year%400==0))
       return 1;
    else 
       return 0;
   }    
   int main()
{
     
     int a[12];
     int i,Year,Month,Day,date=0;
     scanf("%d %d %d",&Year,&Month,&Day);
     if (leapyear(Year)==1)
        {
           int a[12]={31,29,31,30,31,30,31,31,30,31,30,31};
           for (i=0;i<(Month-1);i++)
              date=date+a[i];
           date=date+Day;
           printf("%d\n",date);
        }
     else if (leapyear(Year)==0)
        {
            int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
           for (i=0;i<(Month-1);i++)
              date=date+a[i];
           date=date+Day;
           printf("%d\n",date);
        }
     }
int main()
{
	int y,m,d,x;
	scanf("%d %d %d",&y,&m,&d);
    if (y%4==0)
	    if (y%100==0)
			if (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\n",x);}
			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);}
		else{
            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\n",x);}
	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 run(int x)
{
	if((x%4==0 && x%100!=0)||(x%400==0))return 1;
	return 0;
}
int main()
{
	int y,m,d,x;
    scanf("%d %d %d",&y,&m,&d);
		if(run(y))
		{
			switch(m)
	{
	case 1:x=d;break;
	case 2:x=31+d;break;
	case 3:x=60+d;break;
	case 4:x=91+d;break;
	case 5:x=121+d;break;
	case 6:x=152+d;break;
	case 7:x=182+d;break;
	case 8:x=213+d;break;
	case 9:x=244+d;break;
	case 10:x=274+d;break;
	case 11:x=305+d;break;
	case 12:x=335+d;break;
		}
		}
		else{
			switch(m)
	{
	case 1:x=d;break;
	case 2:x=31+d;break;
	case 3:x=59+d;break;
	case 4:x=90+d;break;
	case 5:x=120+d;break;
	case 6:x=151+d;break;
	case 7:x=181+d;break;
	case 8:x=212+d;break;
	case 9:x=243+d;break;
	case 10:x=273+d;break;
	case 11:x=304+d;break;
	case 12:x=334+d;break;
		}
		}
		printf("%d",x);



	return 0;



}
int main()
{
	int a,b,c,sum;
	scanf("%d%d%d",&a,&b,&c);
	if (b==1)
	{
		printf("%d",c);
	}
	if (b==2)
	{
		sum=31+c;
		printf("%d",sum);
	}
	if (a%4==0&&a%100!=0||a%100==0&&a%400==0)
	{
		if (b==3)
		{
			sum=60+c;
			printf("%d",sum);
		}
		if (b==4)
		{
			sum=91+c;
			printf("%d",sum);
		}
		if (b==5)
		{
			sum=121+c;
			printf("%d",sum);
		}
		if (b==6)
		{
			sum=152+c;
			printf("%d",sum);
		}	
		if (b==7)
		{
			sum=182+c;
			printf("%d",sum);
		}	
		if (b==8)
		{
			sum=213+c;
			printf("%d",sum);
		}	
		if (b==9)
		{
			sum=244+c;
			printf("%d",sum);
		}
		if (b==10)
		{
			sum=274+c;
			printf("%d",sum);
		}	
		if (b==11)
		{
			sum=305+c;
			printf("%d",sum);
		}
		if (b==12)
		{
			sum=335+c;
			printf("%d",sum);
		}
	}
	else 
	{
		if (b==3)
		{
			sum=59+c;
			printf("%d",sum);
		}
		if (b==4)
		{
			sum=90+c;
			printf("%d",sum);
		}
		if (b==5)
		{
			sum=120+c;
			printf("%d",sum);
		}
		if (b==6)
		{
			sum=151+c;
			printf("%d",sum);
		}	
		if (b==7)
		{
			sum=181+c;
			printf("%d",sum);
		}	
		if (b==8)
		{
			sum=212+c;
			printf("%d",sum);
		}	
		if (b==9)
		{
			sum=243+c;
			printf("%d",sum);
		}
		if (b==10)
		{
			sum=273+c;
			printf("%d",sum);
		}	
		if (b==11)
		{
			sum=304+c;
			printf("%d",sum);
		}
		if (b==12)
		{
			sum=334+c;
			printf("%d",sum);
		}
	}
	return 0;
}
int main()
{
	int y,m,d,i,num,leap;
			leap=0;
			cin>>y>>m>>d;
			if(m==1||m==2)
			{
				if(m==1) num=d;
				else num=31+d;
				cout<<num<<endl;
			}
			else
			{
	        	num=(m-1)*30+d;
				if((y%4==0)&&(y%100!=0)||(y%400==0)) leap=1;
				if(leap==1) num=num-1;
				else num=num-2;
				switch(m)
				{
				case 3:num=num+1;break;
				case 4:
				case 5:num=num+2;break;
				case 6:
				case 7:num=num+3;break;
				case 8:
				case 9:num=num+4;break;
				case 10:num=num+5;break;
				case 11:
				case 12:num=num+6;break;
				default :break;
			
				}
				cout<<num<<endl;
			}
	return 0;
}
int main()
{
	int a,b,c,d,i;
	int j=1;
	while(j<=5)
	{
	scanf("%d %d %d",&a,&b,&c);
	i=1;
	d=0;
	while(i<b)
	{
		if (i==1||i==3||i==5||i==7||i==8||i==10)
			d=d+31;
		else if (i==2)
		{
			if (a%4==0&&a%100!=0||a%400==0)
				d=d+29;
			else d=d+28;
		}
		else if (i==4||i==6||i==9||i==11) d=d+30;
		i=i+1;
	}
	d=d+c;
	printf("%d\n",d);
	j=j+1;
	}
	return 0;
}