#include <bits/stdc++.h>   using namespace std;   int read() {     int f = 1, x = 0;     char s = getchar();     while (s <  0  || s >  9 ) {       if (s ==  - ) f = -1;       s = getchar();     }     while (s >=  0  && s <=  9 ) {       x = x * 10 + s -  0 ;       s = getchar();     }     return x * f;   }   int len[300 + 5];   string str[300 + 5];   bool vis[300 + 5][300 + 5];   int main() {     int n = read(), Ans;     for (int i = 1; i <= n; i++) {       cin >> str[i];       len[i] = int(str[i].length()) + len[i - 1];     }     Ans = len[n] + n - 1;     for (int i = 1; i <= n; i++) {       for (int j = i; j <= n; j++) {         int tmp = 0;         if (vis[i][j]) continue;         vis[i][j] = 1;         for (int t = j + 1; t <= n - j + i; t++) {           bool flag = 0;           for (int s = 0; s <= j - i; s++)             if (str[i + s] != str[t + s]) {               flag++;               break;             }           if (!flag) tmp++, t += j - i, vis[t][t + j - i] = 1;         }         if (tmp != 0) {           int tot = len[n] - (tmp + 1) * (len[j] - len[i - 1]) + tmp + n;           Ans = min(Ans, tot);         }       }     }     printf( %d n , Ans);     return 0;   }   