lst = [23, 24, 25] A, B = [int(i) for i in input().strip().split(' ')] print(len(list(set(lst) - set([i for i in range(A, B + 1)]))))