A, B = map(int, input().split()) count = 3 day_list = [23, 24, 25] for i in range(A, B+1): if i in day_list: count -= 1 print(count)