x = gets.to_i y = 1 while true do s = Math.sqrt(x * y) if s.ceil == s.to_i break end y += 1 end puts y