nums=input().split() a=int(nums[0]) b=int(nums[1]) c=(a**2+b**2)**(1/2) import math ans=math.ceil(c*2) if (ans/2)**2==c**2: print(ans+1) else: print(ans)