INF = 1 << 29

def contain(names)
  contained = []
  names.permutation(2).each do |s, t|
    contained << t if s.include?(t)
  end
  contained.each{ |name| names.delete(name) }
  names
end

def overlap(names, size)
  mapping = size.times.map{ [0] * size }
  (0...size).to_a.permutation(2).each do |i, j|
    k = [@len[i], @len[j]].min
    loop do
      if names[i][@len[i]-k..-1] == names[j][0,k]
        mapping[i][j] = k
        break
      end
      k -= 1
    end
  end
  mapping
end


while n = gets.to_i
  break if n == 0
  s = n.times.map{ gets.chomp }
  s = contain(s)
  m = s.size
  @len = s.map{ |name| name.size }
  dp_table = overlap(s, m)
  dp_cache = (1<<m).times.map{ [INF] * m }
  m.times{ |i| dp_cache[1<<i][i] = @len[i] }
  (1<<m).times do |bits|
    m.times do |i|
      next if dp_cache[bits][i] == INF
      pre = dp_cache[bits][i]
      m.times do |j|
        next if i == j || (bits | (1<<j)) == bits
        if dp_cache[bits | (1<<j)][j] > pre + @len[j] - dp_table[i][j]
          dp_cache[bits | (1<<j)][j] = pre + @len[j] - dp_table[i][j]
        end
      end
    end
  end
  
  p dp_cache[(1<<m)-1].min
end