n = 50
sugs = []

calc = []
n.times do |i|
  # res = []
  n.times do |j|
    # res.append((i+1)*(j+1))
    sugs.push((i) + (j)) if (i+1)*(j+1) == n
  end
  # calc.append(res)
end



# count = 0
# search(n, 0, 0, calc, count)
puts sugs.min