p gets.scan(/(?=(c.*?w.*?w))/).map{|(s)|s.size}.min||-1