x,y=map(int,input().split()) z=(x**2+y**2)**0.5 ans=z*2+1 print(int(ans))