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