#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
//C++11
#if __cplusplus == 201103L
#include <tuple>
#endif

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int main(){
  int N;
  while(cin>>N && N){
    vector<string> _city(N);
    REP(i, N) cin>>_city[i];
    vector<string> city;
    REP(i, N){
      bool ok = true;
      REP(j, N){
        if(i != j && _city[i].size() < _city[j].size() && _city[j].find(_city[i]) != -1) ok = false;
        if(i < j && _city[i] == _city[j]) ok = false;
      }
      if(ok) city.push_back(_city[i]);
    }
    N = city.size();
    int d[16][16] = {};
    REP(i, N)REP(j, N)if(i != j){
      string from = city[i];
      string to = city[j];
      int l = min(from.size(), to.size());
      for(int k = 1; k <= l; k++){
        if(from.substr(from.size() - k, k) == to.substr(0, k)){
          d[i][j] = k;
        }
      }
      if(from.size() <= to.size() && to.find(from) != -1) d[i][j] = l;
      if(to.size() <= from.size() && from.find(to) != -1) d[i][j] = l;
    }
    int dp[1<<16][16] = {};
    REP(S, 1<<N)REP(i, N) dp[S][i] = -INF;
    REP(i, N) dp[1<<i][i] = 0;
    REP(S, 1<<N)REP(from, N)if(dp[S][from] != -INF){
      REP(to, N)if(!(S >> to & 1)){
        int NS = S | 1<<to;
        dp[NS][to] = max(dp[NS][to], dp[S][from] + d[from][to]);
      }
    }
    int ans = 0;
    REP(i, N) ans += city[i].size();
    ans -= *max_element(dp[(1<<N)-1], dp[(1<<N)-1] + N);
    cout<<ans<<endl;
  }
  return 0;
}