code python: N = int(input()) count = 0 hour = 0 minute = 0 for i in range(N + 1): a = hour // 10 b = hour % 10 c = minute // 10 d = minute % 10 if a < b and b < c and c < d: count += 1 minute += 1 if minute == 60: minute = 0 hour += 1 if hour == 24: hour = 0 print(count)