A,B = map(int,input().split()) busy = [i for i in range(A,B+1)] ans = 0 for i in range(23,26): if i not in busy: ans += 1 print(ans)