#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e9;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
int n;
vvi dp,c;
vector<bool>ha;
vector<string>in;
int add(string a,string b){//a+b
	int t=min(a.size(),b.size());
	int c=a.size();
	for(int i=t;i>=0;i--){
		bool h=true;
		rep(j,i)if(a[c-i+j]!=b[j])h=false;
		if(h)return b.size()-i;
	}
}
int main(){
	while(cin>>n,n){
		in=vector<string>(n);
		rep(i,n)cin>>in[i];
		sort(all(in));
		n=unique(all(in))-in.begin();
		ha=vector<bool>(n,true);
		rep(i,n)rep(j,n)if(i!=j&&in[i].find(in[j])!=string::npos)ha[j]=false;
		vector<string>tmp;
		rep(i,n)if(ha[i])tmp.pb(in[i]);
		in=tmp;n=in.size();
		int w=(1<<n);
		c=vvi(n,vi(n));
		rep(i,n)rep(j,n)c[i][j]=add(in[i],in[j]);
		dp=vvi(w,vi(n,inf));
		rep(i,n)dp[1<<i][i]=in[i].size();
		loop(i,1,1<<n)rep(j,n)if(i&1<<j)rep(k,n)if((i&1<<k)==0){
			int t=i^1<<k;
			dp[t][k]=min(dp[t][k],dp[i][j]+c[j][k]);
		}
		w--;
		int out=inf;
		rep(i,n)out=min(out,dp[w][i]);
		cout<<out<<endl;
	}
}