M,D=map(int, input().split()) if (M == 8 and D < 22) or M < 8: print(23) else: print(24)