#include<stdio.h>
#define init_year 1977
int year_sumday(int year,int month,int day)
{
    int sum=0;
    int rui[12]={31,29,31,30,31,30,31,31,30,31,30,31};
    int ping[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int ruiflag=0;
    if((year%4==0 &&year%100!=0) || year%400==0) ruiflag=1;
    for(int index=0;index<month-1;index++)
    {
        if(ruiflag==1) sum+=rui[index];else sum+=ping[index];
    }
    sum+=day;
    return sum;
}
int main()
{
    int day,month,year,sum=0;
    int q,r;
    int yldate,yldate2;
    printf("\nplease input year,month,day\n");
    scanf("%d %d %d",&year,&month,&day);
    sum=year_sumday(year,month,day);
    q=(year-init_year)/4;
    r=(year-init_year)%4;
    yldate2=(int)((14*q+10.6*(r+1)+sum)/29.5);
    yldate=(int)(14*q+10.6*(r+1)+sum-29.5*yldate2);
    printf("it is the %d th day.\n",yldate);
    return 0;
}