x,y=map(int,input().split()) a=int(2*(x*x+y*y)**0.5) print(a+(a%1==0))