#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
map<string, int> m;
const int maxn = 305;
int sz[maxn];
int a[maxn];
int nxt[maxn];
int cnt;
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n, res = 0;
  string s;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (!m[s]) m[s] = ++cnt, sz[cnt] = s.size();
    a[i] = m[s];
    res += s.size();
  }
  res += n - 1;
  int total = res;
  for (int lf = 0; lf < n; ++lf) {
    int len = 0;
    for (int ri = lf; ri < n; ++ri) {
      len += sz[a[ri]];
      nxt[0] = -1;
      int cnt = 0;
      int i = 0, k = -1;
      while (i < ri - lf) {
        if (k == -1 || a[lf + i] == a[lf + k]) {
          if (a[lf + ++i] == a[lf + ++k])
            nxt[i] = nxt[k];
          else
            nxt[i] = k;
        } else
          k = nxt[k];
      }
      nxt[ri - lf + 1] = 0;
      i = 0;
      int j = 0;
      while (i < n) {
        if (j == -1 || a[i] == a[lf + j]) {
          ++i, ++j;
          if (j == ri - lf + 1) {
            ++cnt;
            j = nxt[j];
          }
        } else
          j = nxt[j];
      }
      if (cnt != 1) res = min(res, total - cnt * (len - 1));
    }
  }
  cout << res;
}
