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