from math import sqrt Xp,Yp = map(int,input().split()) print(int(sqrt(Xp ** 2 + Yp ** 2) * 2 + 1 + 1e-9))