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