### constant

INF = 1 << 30

### main

loop do
  n = gets.to_i
  break if n == 0

  ctys = Array.new(n){gets.strip}
  #p ctys
  
  oks = Array.new(n){true}
  for i in (0...n)
    for j in (0...n)
      if i != j && oks[j] && ctys[i].include?(ctys[j])
        oks[j] = false
        break
      end
    end
  end
  #p oks

  ctys = (0...n).select{|i| oks[i]}.map{|i| ctys[i]}
  n = ctys.length
  #p ctys

  plens = Array.new(n){Array.new(n){0}}
  for i in (0...n)
    ci = ctys[i]
    li = ci.length
    for j in (0...n)
      next if i == j
      cj = ctys[j]
      lj = cj.length

      k = (li < lj) ? li : lj
      while k > 0
        break if ci[li - k, k] == cj[0, k]
        k -= 1
      end
      plens[i][j] = lj - k
    end
  end
  #p plens

  dp = Array.new(1 << n){Array.new(n){INF}}
  for i in (0...n)
    dp[1 << i][i] = ctys[i].length
  end

  for bits in (1...(1 << n))
    for i in (0...n)
      bi = 1 << i
      if (bits & bi) != 0
        for j in (0...n)
          bj = 1 << j
          if (bits & bj) == 0
            bitsj = bits | bj
            ndp = dp[bits][i] + plens[i][j]
            dp[bitsj][j] = ndp if dp[bitsj][j] > ndp
          end
        end
      end
    end
  end

  puts dp[(1 << n) - 1].min
end