A, B = map(int, input().split()) gassyuku = set([23,24,25]) print(len(gassyuku - set(range(A, B+1))))