#include<iostream>
using namespace std;
int main()
{
int y,m,d,s=0;
scanf("%d,%d,%d",&y,&m,&d);
bool flag=0;
if(y%4==0&&y%100!=0||y%400==0)flag=1;
switch(m)
{
case 1:s=d;break;
case 2:s=31+d;break;
case 3:s=59+d;break;
case 4:s=90+d;break;
case 5:s=120+d;break;
case 6:s=151+d;break;
case 7:s=181+d;break;
case 8:s=212+d;break;
case 9:s=243+d;break;
case 10:s=273+d;break;
case 11:s=304+d;break;
case 12:s=334+d;break;
}
if(flag==1&&m>2)s++;
printf("%d year %d month %d day %d numbers\n",y,m,d,s);
return 0;
}