package homework;
import java.util.Scanner;
public class DayCounter {
int date, year, month, day, totalDays;
DayCounter(int datePrint){
date = datePrint;
day = date % 100;
month = (date / 100) % 100;
year = date / 10000;
}
public int TotalDays() {
int days = 0; //当月天数
totalDays = 0;
for (int i = 1; i < month; i ++) {
switch(i) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
days = 31;
break;
case 4:
case 6:
case 9:
case 11:
days = 30;
break;
case 2:
if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
days = 29;
}
else {
days = 28;
}
}
totalDays += days;
}
totalDays = totalDays + day;
return totalDays;
}
}
class print{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int date = input.nextInt();
DayCounter day = new DayCounter(date);
System.out.println("这是第" + day.TotalDays() + "天");
}
}