#include <stdio.h>
int main(){
int i,year,month,day,d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
scanf("%d-%d-%d",&year,&month,&day);
if((year%4==0&&year%100)||year%400==0)
d[2]=29;
for(i=0;i<month;i++)
day+=d[i];
printf("%d年的第%d天",year,day);
return 0;
}