A, B = map(int, input().split()) if B < 23 or A > 25: print(3) else: print(max(0, 25 - B) + max(0, A - 23))