def main(): m,d = map(int,input().split()) if m <= 7: print(23) elif d >= 22: print(24) else: print(23) if __name__ == "__main__": main()