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