import java.util.Scanner;
/*题目:输入某年某月某日,判断这一天是这一年的第几天?
解题思路:先要判断是不是闰年((year%40)&&(year%100!=0)||(year%4000))
,因为闰年2月会有 29 天,用一个数组存放天数。然后判断出来就行了。*/
public class demo1128_04 {
/**
* @param args
*/
//31 28 31 30 31 30 31 31 30 31 30 31
public static void main(String[] args) {
int days=0;
Scanner sc=new Scanner(System.in);
int year=sc.nextInt();
int mon=sc.nextInt();
int day=sc.nextInt();
int[] months ={31,28,31,30,31,30,31,31,30,31,30,31};
if ((year%40)&&(year%100!=0)||(year%4000)) {
if (mon>2||mon2&&day29) {
for (int i = 0; i < mon; i++) {
days +=months[i];
}
days=days+day+1;
}else {
for (int i = 0; i < mon; i++) {
days +=months[i];
}
days=days+day;
}
}else {
for (int i = 0; i < mon; i++) {
days +=months[i];
}
days=days+day;
}
System.out.println(days);
}
}