题目描述
Problem Description
Takahashi, a novice programmer, was assigned the task of writing a program to calculate the number of days elapsed from a given date to today's date (May 17, 2014) at his part-time job. Struggling with this, he eventually found the following surprising formula while searching online, under the belief that "it must be possible to speed up the process by reducing it to a simpler calculation." The result of this formula represents the number of days elapsed from January 1, 1, to the date y-m-d.
However, when using this formula, for January and February of any year, they should be treated as the 13th and 14th months of the previous year. For example, for February 5, 2012, you must apply the formula with y=2011, m=14, d=5.
For instance, substituting y=2014, m=5, d=17 into this formula yields 735369, indicating that 735369 days have elapsed from January 1, 1, to May 17, 2014.
By applying this formula, it is possible to calculate the difference in days between any two dates. For example, the difference between July 3, 1988, and May 17, 2014, is calculated as (the number of days from January 1, 1, to May 17, 2014) - (the number of days from January 1, 1, to July 3, 1988), which results in 735369 - 725920 = 9449.
Unfortunately, Takahashi got tired from just researching and left the task to you, his colleague, to write the program. Your job is to create a program that calculates the number of days elapsed from a given date to today's date (May 17, 2014).
Input Format
The input is given from the standard input in the following format:
y m d
- The first line contains y (1 ≦ y ≦ 2014).
- The second line contains m (1 ≦ m ≦ 12).
- The third line contains d (1 ≦ d ≦ 31).
- The given date is before May 17, 2014, and does not include invalid dates. That is, for m=4,6,9,11, 1≦d≦30; for m=1,3,5,7,8,10,12, 1≦d≦31. For m=2, if y is a leap year (y is a multiple of 400, or y is a multiple of 4 but not 100), then 1≦d≦29; otherwise, 1≦d≦28.
Output Format
Output the number of days elapsed from y-m-d to May 17, 2014, on a single line.
Sample Input and Output
Sample Input #1
1988
7
3
Sample Output #1
9449
Sample Input #2
1
1
1
Sample Output #2
735369
Sample Input #3
2014
5
16
Sample Output #3
1
Sample Input #4
2012
2
29
Sample Output #4
808
Notes/Hints
Sample Explanation 1
This is the example from the problem statement. 9449 days have elapsed from July 3, 1988, to May 17, 2014.
Sample Explanation 2
Note that in the formula, January and February must be treated as the 13th and 14th months of the previous year (y-1).
Sample Explanation 4
February 29, 2012, is a leap day.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分