a,b=map(int,input().split()) r = (a**2 + b**2)**0.5 t=r*2 + 1 print(int(t))