#include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>
#include <cassert>
using namespace std;

//common
typedef long long ll;

#define BR "\n"
#define ALL(c) (c).begin(),(c).end()
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define EACH(it,o) for(auto it = (o).begin(); it != (o).end(); ++it)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))

//config
//#undef NDEBUG
//#define INF 1<<30
//#define EPS 1e-8
//const ll MOD =100000007;

//debug
#ifdef NDEBUG
#define DUMP(x)
#define DUMPLN(x)
#define DEBUG(x)
#define DEBUGLN(x)
#define LINE()
#define LINELN()
#define CHECK(exp,act)
#define STOP(e)
#else
#define DUMP(x)  cerr << #x << " = " << (x)
#define DUMPLN(x)  DUMP(x) <<endl
#define DEBUG(x) DUMP(x) << LINE() << " " << __FILE__
#define DEBUGLN(x) DEBUG(x)<<endl
#define LINE()    cerr<< " (L" << __LINE__ << ")"
#define LINELN()    LINE()<<endl
#define CHECK(exp,act)  if(exp!=act){DUMPLN(exp);DEBUGLN(act);}
#define STOP(e)  CHECK(e,true);if(!(e)) exit(1);
#endif

template<class T> inline string toString(const vector<T>& x) {
	stringstream ss;
	REP(i,x.size()){
		if(i!=0)ss<<" ";
		ss<< x[i];
	}
	return ss.str();
}

template<class T> inline string toString(const vector<vector<T> >& map) {
	stringstream ss;
	REP(i,map.size()){
		if(i!=0)ss<<BR;
		ss<< toString(map[i]);
	}
	return ss.str();
}
template<class K,class V>  string toString(map<K,V>& x) {
	string res;stringstream ss;
	for(auto& p:x)ss<< p.first<<":" << p.second<<" ";
	return ss.str();
}

//ind -> V から V->ind (注:単射)
template<typename T>
map<T,int> rev(const vector<T>& xs){
	map<T,int> rev;
	REP(i,(int)xs.size())rev.insert(make_pair(xs[i],i));
	return rev;
}

template<typename T,typename V> inline T mod(T v,V MOD){
	return (v%MOD+MOD)%MOD;
}

int INF=1<<28;
class Main{
public:	
	int n;
	vector<vector<int>> dp;
	vector<string>  ns;

	vector<vector<int>> ds;

	void run(){
		while(true){
			cin >> n;
			if(n==0)break;
			ns=vector<string>(n);REP(i,n)  cin>> ns[i];
			
			//contain check
			vector<string> tmp;
			vector<bool> nowrap(n,true);
			REP(i,n)REP(j,n){
				if(i==j)continue;
				if(ns[i].find(ns[j])!=string::npos){
					nowrap[j]=false;
				}
			}
			REP(i,n)if(nowrap[i])tmp.push_back(ns[i]);
			ns=tmp;n=ns.size();

			ds=vector<vector<int> > (n,vector<int>(n,INF));
			REP(i,n)REP(j,n){
				int Mv=0;
				REP(p,ns[i].size()){
					int v=0;
					while(p+v<ns[i].size() &&  v<ns[j].size() && ns[i][p+v]==ns[j][v])v++;
					if(p+v!=ns[i].size())continue;
					Mv=max(Mv,v);
				}
				ds[i][j]=ns[j].size()-Mv;
			}
			dp=vector<vector<int> > (1<<n,vector<int>(n,INF));
			
			REP(i,n) dp[1<<i][i]=ns[i].size();
						
			REP(i,n) dfs((1<<n)-1,i);
			int mv=INF;
			REP(i,n) mv=min(mv,dp[(1<<n)-1][i]);

			cout << mv<<endl;
		}
	}
	void dfs(int bit,int pos){
		if(dp[bit][pos]!=INF) return;
		REP(i,n)if(( ((bit-(1<<pos))>>i) & 1) ==1){
			dfs(bit-(1<<pos),i);
		}
		int mv=INF;
		REP(i,n)if( ( ((bit-(1<<pos))>>i) & 1) ==1){
			// DUMP(dp[bit-(1<<i)][i]+ds[i][pos]);
			mv=min(mv,dp[bit-(1<<pos)][i]+ds[i][pos]);
		}
		//back
		dp[bit][pos]=mv;
	}
};

int main(){
	Main().run();
	return 0;
}

Measured memory_bytes: 4004