from math import floor, sqrt x, y = map(int, input().split()) print(floor(2 * sqrt(x**2 + y**2) + 1))