n = gets.to_i x = Math.sqrt(n).to_i x -= 1 if x * x > n puts x + n / (x + 1)