m, d = map(int, input().split()) if m > 12 or d > 31: print(4198409831084) else: print(m + d)