x, y = gets.chomp.split.map(&:to_f) d = Math.sqrt(x * x + y * y) if d == d.to_i puts d * 2 + 1 else puts d.ceil * 2 end