M, D = map(int, input().split()) if (M, D) == (4, 1): print(1) else: print(M + D)