题目描述
Problem Description
Takahashi was born on New Year's Day of the year $A$ in the Gregorian calendar and plans to leave Earth on New Year's Eve of the year $B$.
Takahashi wants to find out how many times he can experience February 29th on Earth.
February 29th only exists in leap years, and whether a year is a leap year is determined by the following rules:
- A year divisible by 4 is a leap year.
- However, a year divisible by 100 is not a leap year.
- However, a year divisible by 400 is a leap year.
Output the number of times Takahashi can experience February 29th. Note that Takahashi can live for an extremely long time.
Input Format
The input is given from the standard input in the following format:
$ A $ $ B $
- The first line contains two integers $A,\ B\ (1\ ≦\ A\ ≦\ B\ ≦\ 2,000,000,000)$ representing the year Takahashi was born and the year he plans to leave Earth.
Output Format
Output the number of times Takahashi can experience February 29th in one line. Include a newline at the end of the output.
Sample Input and Output
Sample Input #1
1988 2014
Sample Output #1
7
Sample Input #2
997 1003
Sample Output #2
0
Sample Input #3
1 2000000000
Sample Output #3
485000000
Notes/Hints
Partial Points
- Correctly solving all cases where $1\ ≦\ A\ ≦\ B\ ≦\ 3,000$ will award $ 25 $ points.
- Correctly solving all remaining cases will award an additional $ 75 $ points.
The input is given from the standard input in the following format.
Sample Explanation 1
Takahashi can experience February 29th in the years $ 1988 $, $ 1992 $, $ 1996 $, $ 2000 $, $ 2004 $, $ 2008 $, and $ 2012 $, totaling $ 7 $ times.
Sample Explanation 2
Note that the year $ 1000 $ is not a leap year.
Sample Explanation 3
Note that Takahashi can live for an extremely long time.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分