n = gets.to_i m = Integer.sqrt(n) p n/m==m ? m*2-1 : m*2