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