x,y = [int(i) for i in input().split()] ans = x+y if x==4 and y==1: ans += 2 print(ans)