#include <bits/stdc++.h>
using namespace std;
const long long mod = 821611829;
const long long mod1 = 1000000123;
const long long mod2 = 1000000007;
const long long p = 29;
const long long p1 = 31;
const long long p2 = 37;
const int INF = 1000000001;
long long n, total = 0;
long long power[100005], power1[100005], power2[100005], lt[100005], h1[100005],
    h2[100005], pref[100005];
string w[100005];
vector<long long> a;
long long result;
map<pair<long long, long long>, vector<int>> pos;
long long getHash(int l, int r, long long a[], long long p[], long long mod);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  power[0] = power1[0] = power2[0] = 1;
  for (int i = 1; i < 100005; i++) {
    power[i] = power[i - 1] * p % mod;
    power1[i] = power1[i - 1] * p1 % mod1;
    power2[i] = power2[i - 1] * p2 % mod2;
  }
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> w[i];
    pref[i] = (i ? pref[i - 1] + 1 : 0) + w[i].size();
    for (int j = 0; j < w[i].size(); j++)
      a[i] = (a[i] * p + (w[i][j] - 'a' + 1)) % mod;
  }
  long long hd1 = 0, hd2 = 0;
  for (int i = 0; i < n; i++) {
    hd1 = (hd1 * p1 + a[i] + 1LL) % mod1;
    hd2 = (hd2 * p2 + a[i] + 1LL) % mod2;
    h1[i] = hd1;
    h2[i] = hd2;
  }
  result = total = pref[n - 1];
  for (int len = 1; len <= n / 2; len++) {
    pos.clear();
    for (int i = 0; i + len <= n; i++)
      pos[make_pair(getHash(i, i + len - 1, h1, power1, mod1),
                    getHash(i, i + len - 1, h2, power2, mod2))]
          .push_back(i);
    for (auto it : pos) {
      int pr = -INF;
      int cnt = 0;
      for (auto jt : it.second) {
        if (jt - pr >= len) {
          pr = jt;
          cnt++;
        }
      }
      if (cnt > 1) {
        int d = it.second[0];
        long long t = pref[d + len - 1] - pref[d] + w[d].size();
        result = min(result, total - cnt * t + cnt * len);
      }
    }
  }
  cout << result << "\n";
  return 0;
}
long long getHash(int l, int r, long long h[], long long p[], long long mod) {
  if (l < 1) return h[r];
  return ((h[r] - h[l - 1] * p[r - l + 1]) % mod + mod) % mod;
}
