#P8831. [传智杯 #3 练习赛] 儒略历
[传智杯 #3 练习赛] 儒略历
Description
Before 1582, any year that is a multiple of is a leap year. Normally, the numbers of days in January to December are . If the year is a leap year, then February has days.
However, a pope found that this rule was not accurate enough and would cause errors. Therefore, starting from 1582, a year that is a multiple of is a leap year unless it is a multiple of but not a multiple of . At the same time, to remove the error, it was规定 that the day after October , 1582 is October , 1582, and the dates in between are considered not to exist.

Now you are given a date. Compute how many days have passed from this date to January , year AD.
Input Format
Input the data in the format day month year, where day is an integer between and , month is three uppercase letters, and year is an integer between and . It is guaranteed that the date is valid and exists.
The uppercase letters for months:
- January: JAN
- February: FEB
- March: MAR
- April: APR
- May: MAY
- June: JUN
- July: JUL
- August: AUG
- September: SEP
- October: OCT
- November: NOV
- December: DEC
Output Format
Output an integer representing the answer.
1JAN1
0
4OCT1582
577736
15OCT1582
577737
21NOV2020
737751
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号