#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

const int N = 15;
const int INF = 0xfffffff;

int dp[N][1<<15];
char str[N][25];
int AddNum[N][N];

template< typename T > T Max(T a, T b) { return a>b?a:b; }
template< typename T > T Min(T a, T b) { return a<b?a:b; }

bool judge( int i, int j  )
{
    if ( strcmp( str[i], str[j] ) == 0 ) return true;
    int leni = strlen(str[i]), lenj = strlen(str[j]);
    int k, p;
    for ( k = 0; k <= leni-lenj; k++ )
    {
        for ( p = 0; p < lenj && k+p < leni; p++ )
            if ( str[i][k+p] != str[j][p] ) break;
        if ( p == lenj) return true;
    }
    for ( k = 0; k <= lenj-leni; k++ )
    {
        for ( p = 0; p < leni && k+p < lenj; p++ )
            if ( str[i][p] != str[j][k+p] ) break;
        if ( p == leni) return true;
    }
    return false;
}

int PreInit(int li, int lj)
{
    int leni = strlen(str[li]), lenj = strlen( str[lj] );
    int next[25];
    int i = 0,j = 0, k = -1; next[0] = -1;
    while (j< lenj)
    {
        if ( k == -1 || str[lj][j] == str[lj][k] ) next[++j] = ++k;
        else k = next[k];
    }
    i = 0, j = 0;
    while ( i < leni )
    {
        if ( j == -1 || str[li][i] == str[lj][j] )
        {
            ++i, ++j;
            if ( j == lenj ) return lenj-j;
        }
        else j = next[j];
    }
    return lenj - j;
}

//int PreInit(int i,int j)//荳、荳ェ蟄礼ャヲ荳イ霑樊磁蠅槫刈逧?柄蠎ヲ
//{
//    int l,k,p;
//    int len1=strlen(str[i]);
//    int len2=strlen(str[j]);
//    int len=min(len1,len2);
//    for(l=len; l>=0; l--)
//    {
//        for(k=len1-l,p=0; k<len1&&p<len2; k++,p++)
//            if(str[i][k]!=str[j][p])
//                break;
//        if(k==len1||p==len2)
//            return len2-l;
//    }
//}

int dfs( int k, int state,const int &n )
{
    if ( dp[k][state] != INF ) return dp[k][state];
    if ( state == 0 ) return dp[k][0]=0;

    for ( int i = 0; i < n; i++ )
    {
        if ( state&(1<<i) )
        {
            int sta = state^(1<<i);
            dp[k][state] = Min( dp[k][state], dfs( i, sta, n )+AddNum[k][i] );
        }
    }
    return dp[k][state];
}

int main()
{
//    #ifndef ONLINE_JUDGE
//        freopen( "test.in", "r", stdin );
//    #endif
    int n;
    while ( scanf("%d", &n) != EOF )
    {
        if ( n == 0 ) break;

        for ( int i = 0; i < n; i++ )
        {
            scanf("%s", str[i]);
            for ( int j = 0; j < i; j++ )
                if ( judge(i, j) )
                {
                    if ( strlen( str[i] ) > strlen( str[j] ) )
                        strcpy( str[j], str[i] );
                    i--, n--;
                }
        }
        memset(AddNum, 0, sizeof(AddNum));
        for ( int i = 0; i < n; i++ )
            for ( int j = 0; j < n; j++ )
                AddNum[i][j] = PreInit(i, j);

        for ( int i = 0; i < n; i++ )
            for ( int j = 0; j < (1<<n); j++ )
                dp[i][j] = INF;
        int ans = INF;
        int state = (1<<n)-1;
        for ( int i = 0; i < n; i++ )
        {
            ans = Min( ans, dfs( i, state^(1<<i), n )+ (int)strlen( str[i] ) );
        }

        printf("%d\n", ans);
    }
    return 0 ;
}

Measured memory_bytes: 2156