X, Y = map(int, input().split()) r = int((X ** 2 + Y ** 2) ** 0.5 * 2) if (X ** 2 + Y ** 2) * 4 >= r ** 2: r += 1 print(r)