X, Y = map(int, input().split()) t = (X**2+Y**2)**0.5*2 print(int(t+1))