m, d = map(int, input().split()) if m <8: print(23) elif m >= 8 and d < 22: print(23) else: print(24)