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