import math x,y=map(int,input().split()) print(math.ceil(math.sqrt(x*x+y*y)*2+1E-12))