#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 69, base = 1024 * 1024, mod = 1e17 + 2139, mn = 37;
string S[N];
long long n, wynik;
map<long long, vector<pair<pair<long long, long long>, long long>>> M;
int32_t main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> S[i];
  for (int i = 1; i <= n; i++) {
    long long ha = 0, ile = 0;
    for (int j = i; j <= n; j++) {
      for (int k = 0; k < S[j].size(); k++) {
        ha *= mn;
        ha += S[j][k] - 'a' + 1;
        ha %= mod;
        ile++;
      }
      ha += 35;
      ha %= mod;
      M[ha].push_back(make_pair(make_pair(i, j), ile - (j - i + 1)));
      ile++;
    }
  }
  for (auto it = M.begin(); it != M.end(); it++) {
    vector<pair<pair<long long, long long>, long long>> vek = (*it).second;
    sort(vek.begin(), vek.end());
    int re = 0;
    int akt = -1, il = 0;
    for (int i = 0; i < vek.size(); i++) {
      if (vek[i].first.first > akt) {
        akt = vek[i].first.second;
        re += vek[i].second;
        il++;
      }
    }
    if (il > 1) wynik = max(wynik, (long long)re);
  }
  wynik = -wynik;
  for (int i = 1; i <= n; i++) wynik += S[i].size();
  wynik += n - 1;
  cout << wynik << "\n";
}
