#include <bits/stdc++.h>
using namespace std;
const int maxn = 300 + 10;
const int maxm = 100000 + 10;
map<string, int> mp;
char s[maxm];
int n, res, sum, i, j, k, a[maxn], len[maxn], nxt[maxn];
int getId(const string& t) {
  if (!mp[t]) mp[t] = (int)mp.size();
  return mp[t];
}
int kmp(int a[], int n, int b[], int m) {
  int i, j, res = 0;
  for (nxt[0] = j = -1, i = 1; i < n; nxt[i++] = j) {
    while (~j && a[j + 1] != a[i]) j = nxt[j];
    j += (a[j + 1] == a[i]);
  }
  for (j = -1, i = 0; i < m; i++) {
    while (~j && a[j + 1] != b[i]) j = nxt[j];
    j += (a[j + 1] == b[i]);
    if (j == n - 1) res++, j = -1;
  }
  return res;
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> s;
    a[i] = getId(s);
    len[i] = strlen(s);
  }
  for (sum = n - 1, i = 1; i <= n; i++) sum += len[i];
  res = sum;
  for (i = 1; i <= n; i++) {
    for (j = i; j <= n; j++) {
      int cnt = kmp(a + i, j - i + 1, a + 1, n);
      if (cnt >= 2) {
        int tot = j - i;
        for (k = i; k <= j; k++) tot += len[k] - 1;
        res = min(res, sum - tot * cnt);
      }
    }
  }
  cout << res << endl;
  return 0;
}
