#P8831. [传智杯 #3 练习赛] 儒略历

[传智杯 #3 练习赛] 儒略历

Description

Before 1582, any year that is a multiple of 44 is a leap year. Normally, the numbers of days in January to December are 31,28,31,30,31,30,31,31,30,31,30,3131, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31. If the year is a leap year, then February has 2929 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 44 is a leap year unless it is a multiple of 100100 but not a multiple of 400400. At the same time, to remove the error, it was规定 that the day after October 44, 1582 is October 1515, 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 11, year 11 AD.

Input Format

Input the data in the format day month year, where day is an integer between 11 and 3131, month is three uppercase letters, and year is an integer between 11 and 99999999. 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