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