#include <bits/stdc++.h>
using namespace std;
const int maxn = 310;
int mod[3];
int n;
string s[maxn];
long long ha[maxn][3];
int prel[maxn];
int main() {
  ios::sync_with_stdio(false);
  mod[0] = 1e9 + 7;
  mod[1] = 1e9 + 9;
  mod[2] = 19260817;
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    int l = s[i].size();
    for (int j = l - 1; j >= 0; j--) {
      for (int k = 0; k < 3; k++) {
        ha[i][k] = (ha[i][k] * 131 + s[i][j]) % mod[k];
      }
    }
    prel[i] = prel[i - 1] + l;
  }
  ans = prel[n] + n - 1;
  int res = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      int len = j - i + 1, cnt = 0;
      for (int k = j + 1; k + len - 1 <= n; k++) {
        bool f = 1;
        for (int l = 0; l < len; l++) {
          if (ha[i + l][0] != ha[k + l][0] || ha[i + l][1] != ha[k + l][1] ||
              ha[i + l][2] != ha[k + l][2]) {
            f = 0;
            break;
          }
        }
        if (f) cnt++, k += len - 1;
      }
      if (cnt == 0) continue;
      res = max(res, (cnt + 1) * (prel[j] - prel[i - 1] - 1));
    }
  }
  cout << ans - res << endl;
  return 0;
}
