import math x,y=map(int,input().split()) h=math.hypot(x,y)*2 if h - h == 0: h+=1 print(int(h))