import sys readline=sys.stdin.readline write=sys.stdout.write M,D=map(int,readline().split()) if (M,D)==(4,1): ans=0 else: ans=M+D print(ans)