#include <bits/stdc++.h>
using namespace std;
int N;
vector<string> sa;
vector<int> a;
map<pair<long long, long long>, vector<pair<int, int>>> hash2Pos;
map<string, int> w2i;
long long sub[400][400];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  sa.assign(N, "");
  a.assign(N, 0);
  for (int i = 0, j = 0; i < N; ++i) {
    string s;
    cin >> s;
    sa[i] = s;
    if (!w2i.count(s)) {
      w2i[s] = ++j;
    }
    a[i] = w2i[s];
  }
  for (int i = 0; i < a.size(); ++i) {
    long long MUL = 401, MOD = (1LL << 31) - 1, MOD2 = 998244353;
    long long sum = 0, sum2 = 0;
    long long sumChar = 0;
    for (int j = i; j < a.size(); ++j) {
      sumChar += sa[j].size();
      sub[i][j] = sumChar - 1;
      sum = (sum * MUL + a[j]) % MOD;
      sum2 = (sum2 * MUL + a[j]) % MOD2;
      long long key1 = (sum * MUL + (j - i + 1)) % MOD;
      long long key2 = (sum2 * MUL + (j - i + 1)) % MOD2;
      pair<long long, long long> key = pair<long long, long long>{key1, key2};
      if (!hash2Pos.count(key)) {
        hash2Pos[key] = *new vector<pair<int, int>>();
      }
      hash2Pos[key].push_back(pair<int, int>{i, j});
    }
  }
  long long ans = 0;
  for (auto it : hash2Pos) {
    vector<pair<int, int>> &ve = it.second;
    sort(ve.begin(), ve.end());
    int l = 0, pos = 0;
    long long cnt = 0;
    while (true) {
      pos = lower_bound(ve.begin() + pos, ve.end(), pair<int, int>{l, 0}) -
            ve.begin();
      if (pos >= ve.size()) {
        break;
      }
      l = ve[pos].second + 1;
      ++cnt;
    }
    if (cnt > 1) {
      ans = max(cnt * sub[ve.begin()->first][ve.begin()->second], ans);
    }
  }
  cout << sub[0][N - 1] + N - ans << endl;
  return 0;
}
