A,B = list(map(int,input().split())) if A < 23 and B > 25: print(3) elif A < 23 and 23 < B <= 25: print(B - 23) elif 23 <= A <= 25: print(A - 23) else: print(0)