#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

const int INF = 100000000;

int n, size;
set<string> city;
vector<string> node;
int cost[14][14];

bool isContained(string a, string b){
  if(b.find(a) != string::npos) return true;
  return false;
}

int solve(){
  int dp[1<<14][14];
  fill(dp[0], dp[1<<14], INF);
  for(int i=0;i<size;++i) dp[1<<i][i] = node[i].size();
  for(int i=0;i<(1<<size);++i){
    for(int j=0;j<size;++j){
      for(int k=0;k<size;++k){
        dp[i|(1<<k)][k] = min(dp[i|(1<<k)][k], dp[i][j] + cost[j][k]);
      }
    }
  }
  int ans = INF;
  for(int i=0;i<size;++i){
    ans = min(ans, dp[(1<<size)-1][i]);
  }
  return ans;
}

int main(){
  while(cin >> n && n){
    city.clear();
    for(int i=0;i<n;++i){
      string name;
      cin >> name;
      city.insert(name);
    }
    node.clear();
    for(set<string>::iterator i=city.begin();i!=city.end();++i){
      bool f = true;
      for(set<string>::iterator j=city.begin();j!=city.end();++j){
        if(i == j) continue;
        if(isContained(*i, *j)){
          f = false;
          break;
        }
      }
      if(f) node.push_back(*i);
    }
    size = node.size();
    for(int i=0;i<size;++i){
      for(int j=0;j<size;++j){
        if(i == j){
          cost[i][j] = 0;
          continue;
        }
        int msize = min(node[i].size(), node[j].size());
        bool f = false;
        for(int k=msize;k>0;--k){
          if(node[i].substr((int)node[i].size()-k, k) == node[j].substr(0, k)){
            cost[i][j] = (int)node[j].size() - k;
            f = true;
            break;
          }
        }
        if(!f) cost[i][j] = (int)node[j].size();
      }
    }
    cout << solve() << endl;
  }
  return 0;
}