x,y=map(int,input().split())
res=0
if abs(x)<=y:
n=y
res=2*n*(2*n-1)+x-(-n)
elif abs(y)<=x:
n=x
res=(2*n)**2+abs(y-n)
elif abs(x)<=abs(y):
n=abs(y)
res=2*n*(2*n+1)+abs(x-n)
else:
n=abs(x)
res=(2*n-1)**2+abs(y-(x+1))
print(res)