#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int main()
{
    while(1){
        int n;
        scanf("%d",&n);
        if(n == 0){
            break;
        }
        string s[14];
        int d[14][14];
    	rep(i,n){
    		cin >> s[i];
    	}
        set<int> inc;
        rep(i,n){
            for(int j=i+1;j<n;j++){
                string s1,s2;
                int flag;
                if(s[i].length() > s[j].length()){
                    s1 = s[i];
                    s2 = s[j];
                    flag = 0;
                }else{
                    s1 = s[j];
                    s2 = s[i];
                    flag = 1;
                }
                rep(k,s1.length()-s2.length()+1){
                    bool ff = false;
                    rep(l,s2.length()){
                        if(s1[k+l] != s2[l]){
                            ff =true;
                            break;
                        }
                    }
                    if(!ff){
                        flag += 2;
                        break;
                    }
                }
                if(flag >= 2){
                    if(flag == 2){
                        inc.insert(j);
                    }else{
                        inc.insert(i);
                    }
                }
            }
        }
        vector<int> id;
        rep(i,n){
            if(inc.find(i) == inc.end()){
                id.push_back(i);
            }
        }
        int nn = id.size();
        rep(i,nn){
            rep(j,nn){
                if(i != j){
                    int cnt = 0;
                    for(int k=1;k<=min(s[id[i]].length(),s[id[j]].length());k++){
                        bool flag = false;
                        rep(l,k){
                            if(s[id[i]][s[id[i]].length()-k+l] != s[id[j]][l]){
                                flag = true;
                                break;
                            }
                        }
                        if(!flag){
                            cnt = k;
                        }
                    }
                    d[i][j] = cnt;
                }else{
                    d[i][j] = 0;
                }
            }
        }
        int dp[(1 << 14)][14];
        rep(i,1 << nn){
            rep(j,nn){
                dp[i][j] = -INF;
            }
        }
        rep(i,nn){
            dp[(1<<nn)-1][i] = 0;
        }
        for(int i=(1<<nn)-2;i>=0;i--){
            rep(j,nn){
                rep(k,nn){
                    if(!(i & (1<<k))){
                        dp[i][j] = max(dp[i][j],dp[i|(1<<k)][k] + d[j][k]);
                    }
                }
            }
        }
        int mx = 0;
        rep(i,nn){
            mx = max(mx,dp[(1<<i)][i]);
        }
        int sm = 0;
        rep(i,nn){
            sm += s[id[i]].length();
        }
        printf("%d\n",sm-mx);
    }
	return 0;
}