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