#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
using namespace std;
string s[300];
vector<int> v[300];
bool m[300][300][300];
int ans[300][300][300];
int main() {
  int n, i, j, go = 0;
  cin >> n;
  go += n - 1;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    go += s[i].length();
    for (j = 0; j < i; j++) {
      if (s[i] == s[j]) {
        v[j].push_back(i);
        v[i].push_back(j);
      }
    }
  }
  vector<int>::iterator w;
  int q, to, o = go;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      to = 0;
      for (q = 0; q < j - i; q++) {
        if (j + q == n) break;
        w = lower_bound((v[j + q]).begin(), (v[j + q]).end(), i + q);
        if (!(w != v[j + q].end() && *w == i + q)) {
          break;
        }
        m[i][j][q] = 1;
        to += s[i + q].length();
        ans[i][j][q] = to;
      }
    }
  }
  int e = 0, r;
  for (q = 0; q < n; q++) {
    for (i = 0; i < n; i++) {
      if (i + q + 1 >= n) break;
      j = i + 1 + q;
      e = 1;
      while (j < n) {
        if (m[i][j][q]) {
          r = j;
          e++;
          j += q + 1;
        } else {
          j++;
        }
      }
      if (e > 1) {
        o = min(o, go - ans[i][r][q] * e + e);
      }
    }
  }
  cout << o;
}
