import java.util.Calendar;
import java.util.Scanner;
/**
* HJ73 计算日期到天数转换 - 简单
*/
public class HJ073 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int year = sc.nextInt();
int month = sc.nextInt();
int day = sc.nextInt();
Calendar c = Calendar.getInstance();//实例化
c.set(year, month - 1, day);//注意月份从0开始
System.out.println(c.get(Calendar.DAY_OF_YEAR));
sc.close();
}
}