object Main {
    def check(n: Int, arr: List[String]) = {
        val vowels = List('a', 'i', 'u', 'e', 'o')
        val x = arr.map(s => (s.head + s.zip(s.tail).collect{case cc if vowels.contains(cc._1) => cc._2}.mkString).take(n))
        x.size == x.distinct.size
    }
    def main(args: Array[String]) = {
        val in = io.Source.stdin.getLines
        for (n <- in if n != "0") {
            val x = in.take(n.toInt).toList
            (1 to 50).find(d => check(d, x)) match {
                case Some(x) => println(x)
                case None => println(-1)
            }
        }
    }
}