import std.stdio;
import std.ascii;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.random;
import std.regex;
import std.typecons;

int _C(in string s, in string t) {
    int L = cast(int)(min(s.length, t.length));
    for (; L >= 0; L--) {
        if (s[$ - L .. $] == t[0 .. L]) return L;
    }
    assert(0);
}
alias memoize!_C C;

void main() {
    int N;
    string[] F;
    bool input() {
        scanf("%d\n", &N);
        if (N == 0) return false;
        F = new string[N];
        foreach (i; 0 .. N) {
            F[i] = readln.chomp;
        }
        return true;
    }
    void removeDup() {
        auto R = new bool[N];
        foreach (i; 0 .. N) {
            foreach (j; 0 .. N) {
                if (i == j) continue;
                if (F[i].countUntil(F[j]) >= 0) R[j] = true;
            }
        }
        string[] nF;
        foreach (i; 0 .. N) {
            if (!R[i]) nF ~= F[i];
        }
        F = nF;
        N = cast(int)F.length;
    }
    const INF = int.max / 4;
    void solve() {
        removeDup;
        auto memo = new int[][](N, 1 << N);
        foreach (i; 0 .. N) memo[i][] = -1;
        int dfs(int v, int bit) {
            if (bit == (1 << N) - 1) return 0;
            if (memo[v][bit] >= 0) return memo[v][bit];
            int Ret = INF;
            foreach (int i; 0 .. N) {
                if (bit & (1 << i)) continue;
                Ret = min(Ret, dfs(i, bit | 1 << i) + F[i].length - C(F[v], F[i]));
            }
            return memo[v][bit] = Ret;
        }
        int Ans = INF;
        foreach (i; 0 .. N) {
            Ans = min(Ans, dfs(i, 1 << i) + cast(int)F[i].length);
        }
        writeln(Ans);
    }
    while (input) solve;
}