x, y = gets.split.map(&:to_i) d = (x ** 2 + y ** 2) ** 0.5 p (e=d.ceil) == d ? (d*2+1).to_i : (e*2).to_i