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