Vova considers a date written in the format DDMMYYYY to be beautiful if, when reversed, it still represents a valid calendar date. For example, September , () is beautiful, as reversing it gives February , (), which is a valid date. However, April , () is not beautiful, because reversing it results in the non-existent st month of the year . Vova wants to know how many such beautiful dates exist between his birthday and the day he started first grade, inclusive. Help him determine this number.
The first line contains Vova's birthday in the format DDMMYYYY, and the second line contains the day he started first grade, also in the format DDMMYYYY. Both dates are valid and range from January , year one (written as 01010001) to December , (written as 31129999).
Output the total number of beautiful dates.
Example 1