
Jimin, who has been living on his own for a year, loves frozen food.
As usual, Jimin is heating frozen food in the microwave today. Waiting for the food to warm up is so boring that he decides to count how many of the times shown on the microwave display, in the form HH:MM, contain the digit N. Hours and minutes are always shown with two digits, with a leading 0 for single-digit values (for example, 09:05).
Write a program that counts how many times from the start time to the end time, inclusive, contain the digit N at least once.