#include <bits/stdc++.h>
const int INFI = (1 << 29);
const long long INFL = (1LL << 62);
using namespace std;
const long long MOD = 546372839LL;
const long long p = 31LL;
long long n;
vector<pair<long long, long long> > v;
long long Hash(const string &s) {
  long long hash = 0, mult = 1;
  for (long long i = 0; i < int(s.size()); i++) {
    hash = (((hash % MOD) + (((s[i] - 'a' + 1) * (mult % MOD)) % MOD)) % MOD);
    mult = (((mult % MOD) * p) % MOD);
  }
  return hash;
}
vector<long long> borde(const long long &l, const long long &r) {
  vector<pair<long long, long long> > vv;
  for (long long i = l; i <= r; i++) vv.push_back(v[i]);
  vv.push_back({-1, 0});
  for (long long i = 0; i < n; i++) vv.push_back(v[i]);
  vector<long long> b(int(vv.size()), 0);
  for (long long i = 1, j = 0; i < int(vv.size()); i++) {
    while (j && vv[i].first != vv[j].first) j = b[j - 1];
    j += (vv[i].first == vv[j].first);
    b[i] = j;
  }
  return b;
}
void solve() {
  long long szOriginal = 0;
  string s;
  cin >> n;
  v.resize(n);
  for (long long i = 0; i < n; i++) {
    cin >> s;
    szOriginal += int(s.size()) + (i > 0);
    v[i] = {Hash(s), int(s.size())};
  }
  long long r = szOriginal;
  for (long long i = 0; i < n; i++) {
    long long szActual = 0;
    for (long long j = 0; j < n; j++) {
      if (i + j >= n) break;
      szActual += v[i + j].second + (j > 0);
      vector<long long> b = borde(i, i + j);
      long long cant = 0;
      for (long long k = j + 2; k <= int(b.size()) - 1; k++) {
        if (b[k] == j + 1) {
          cant++;
          k += j;
        }
      }
      if (cant < 2) continue;
      r = min(r, ((szOriginal - szActual * cant) + ((j + 1) * cant)));
    }
  }
  cout << r << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
