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