#include <bits/stdc++.h>
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
using namespace std;
void file() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  file();
  int n;
  cin >> n;
  vector<string> v(n);
  for (auto& e : v) cin >> e;
  int idx = 1;
  vector<int> vv(n);
  map<string, int> vis;
  for (int i = 0; i < n; i++) {
    if (vis.find(v[i]) == vis.end()) {
      vis[v[i]] = idx++;
    }
    vv[i] = vis[v[i]];
    ;
  }
  vector<long long> pref(n);
  vector<int> temp;
  map<vector<int>, int> mp;
  map<vector<int>, int> lastOccur;
  long long total = 0, mn;
  for (int i = 0; i < n; i++) pref[i] = int(v[i].size());
  for (int i = 1; i < n; i++) pref[i] += pref[i - 1];
  for (int i = 0; i < n; i++) total += int(v[i].size());
  mn = total + (n - 1);
  total = mn;
  for (int i = 0; i < n; i++) {
    for (int k = i; k < n; k++) {
      temp.clear();
      for (int j = i; j <= k; j++) {
        temp.push_back(vv[j]);
      }
      if (lastOccur.find(temp) == lastOccur.end() || lastOccur[temp] < i) {
        mp[temp]++;
        lastOccur[temp] = k;
        if (mp[temp] > 1) {
          int cnt = mp[temp];
          long long removedCh = (pref[k] - (i != 0 ? pref[i - 1] : 0));
          int spaces = k - i;
          mn = min(total - removedCh * cnt + (k - i + 1) * cnt - spaces * cnt,
                   mn);
        }
      }
    }
  }
  cout << mn << '\n';
}
