A, B = map(int, input().split()) ans = 3 if B >= 23 and A <= 25: ans = 3 - (min(B, 25) - max(A, 23) + 1) print(ans)