days = input().split(" ") days = [int(i) for i in days] counter = 3 for x in range(23, 26): if (days[0] <= x) and (x <= days[1]): counter -= 1 print(counter)