// AOJ 1320: City Merger
// 2017.12.31 bal4u@uu

#include <stdio.h>
#include <string.h>

#define INF 0x70707070
char *city[15]; int csz[15]; int sz;
char name[15][22]; int nsz[15]; char f[15];
int dp[16][16];
int memo[16][65536];

int naiveMatch(char *text, int len, char *pattern, int patlen)
{
    char c;
    char *tp, *pp;
    char *textEnd, *patEnd;

    if (len < patlen) return 0;

    textEnd = text + len - patlen + 1;
    patEnd  = pattern + patlen;

    c = *pattern++;
    while (text != textEnd) {
        if (*text++ == c) {
            tp = text;
            pp = pattern;
            do if (pp == patEnd) return 1;
            while (*tp++ == *pp++);
        }
    }
    return 0;
}

int calc(int n, int k, int s)
{
	int i, t, ans;

	if (memo[k][s] < INF) return memo[k][s];
	if (s == (1<<k)) return dp[k][k];
	ans = INF;
	for (i = 0; i < n; i++) {
		if (i == k) continue;
		if ((s >> i) & 1) {
			t = dp[k][i] + calc(n, i, s-(1<<k));
			if (ans > t) ans =  t;
		}
	}
	return memo[k][s] = ans;
}

int main()
{
	int n, i, j, k, lim, ans;

	while (scanf("%d", &n) && n > 0) {
		for (i = 0; i < n; i++) {
			scanf("%s", name[i]), nsz[i] = strlen(name[i]);
		}

		memset(f, 0, sizeof(f));
		for (i = 0; i < n; i++) {
			if (f[i]) continue;
			for (j = 0; j < n; j++) if (j != i) {
				if (naiveMatch(name[i], nsz[i], name[j], nsz[j])) f[j] = 1;
			}
		}

		sz = 0;
		for (i = 0; i < n; i++) {
			if (f[i]) continue;
			city[sz] = name[i], csz[sz++] = nsz[i];
		}

		memset(dp, INF, sizeof(dp));
		for (i = 0; i < sz; i++) for (j = 0; j < sz; j++) {
			k = csz[i]-csz[j];
			if (k < 0) k = 0;
			while (1) {
				if (k == csz[i]) { dp[i][j] = csz[i]; break; }
				if (memcmp(city[i]+k, city[j], csz[i]-k) == 0) {
					dp[i][j] = k; break;
				}
				k++;
			}
		}
		for (i = 0; i < sz; i++) dp[i][i] = csz[i];

		ans = INF, lim = (1<<sz) - 1;
		memset(memo, INF, sizeof(memo));
		for (i = 0; i < sz; i++) {
			k = calc(sz, i, lim);
			if (k < ans) ans = k;
		}
		printf("%d\n", ans);
	}
	return 0;
}