#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cout<<(#v)<<":";for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;
#define printVS(vs) cout<<(#vs)<<":"<<endl;for(auto(s):(vs)){cout<<(s)<< endl;}
#define printVV(vv) cout<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;}
#define printP(p) cout<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cout<<(#vp)<<":"<<endl;for(auto(p):(vp)){cout<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cerr << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cerr << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 2e9;
const int mod = 1e9 + 7;

// Is T a subsequence of S ?
bool contain(string s, string t) {
    int n = s.size();
    int m = t.size();
    if (n < m) return false;
    int j = 0;
    rep(i, n) {
        if (s[i] == t[j]) {
            j++;
            if (j == m) {
                return true;
            }
        }
    }
    return false;
}

// how many chars match between suffix of s and prefix of t?
int match(string s, string t) {
    for (int k = min(s.size(), t.size()); k >= 0; k--) {
        if (s.substr((int)s.size() - k) == t.substr(0, k)) {
            return k;
        }
    }
}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    while (cin >> n, n) {
        vector<string> s(n);
        rep(i, n) cin >> s[i];

        vector<bool> alive(n, true);
        // rep(i, n) {
        //     rep(j, n) {
        //         if (i == j) continue;
        //         if (contain(s[i], s[j])) {
        //             alive[j] = false;
        //         }
        //     }
        // }

        rep(i, n) {
            rep(j, n) {
                if (i == j) continue;
                if (s[i].find(s[j]) != string::npos) {
                    alive[j] = false;
                }
            }
        }

        s = [&]() {
            vector<string> t;
            rep(i, n) {
                if (alive[i]) {
                    t.emplace_back(s[i]);
                }
            }
            return t;
        }();
        int n = s.size();

        vvi cost(n, vi(n));
        rep(i, n) {
            rep(j, n) {
                if (i == j) continue;
                cost[i][j] = s[j].size() - match(s[i], s[j]);
            }
        }

        vvi dp(1 << n, vi(n, inf));
        rep(i, n) {
            dp[1 << i][i] = s[i].size();
        }

        rep(i, 1 << n) {
            rep(j, n) { // used before
                if (!((i >> j) & 1)) continue;
                rep(k, n) { // will use
                    if ((i >> k) & 1) continue;
                    chmin(dp[i | (1 << k)][k], dp[i][j] + cost[j][k]);
                }
            }
        }

        cout << *min_element(all(dp.back())) << endl;
    }

}

Measured memory_bytes: 5124