#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  map<string, int> smp;
  int ctr = 1, arr[n], pow[n], cpow[n];
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (smp[s] == 0) {
      smp[s] = ctr++;
    }
    arr[i] = smp[s];
    cpow[i] = pow[i] = s.size();
    if (i > 0) cpow[i] += cpow[i - 1];
  }
  int mx = 0;
  for (int i = 0; i < n; i++) {
    int curr = 0;
    set<int> st;
    st.insert(i);
    curr += pow[i] - 1;
    for (int j = i + 1; j < n; j++) {
      if (arr[i] == arr[j]) {
        st.insert(j);
        curr += pow[j] - 1;
      }
    }
    if (st.size() > 1)
      mx = max(mx, curr);
    else
      continue;
    for (int j = 2; (i + j) <= n; j++) {
      int en = i - 1, num = 0;
      curr = 0;
      set<int> st1;
      for (auto k : st) {
        if ((k + j) <= n && arr[k + j - 1] == arr[i + j - 1]) {
          st1.insert(k);
          if (k > en) {
            curr += cpow[k + j - 1] - 1;
            if (k > 0) curr -= cpow[k - 1];
            en = k + j - 1;
            num++;
          }
        }
      }
      if (num > 1) mx = max(mx, curr);
      st = st1;
    }
  }
  mx = -mx;
  for (int i = 0; i < n; i++) mx += pow[i] + 1;
  mx--;
  cout << mx;
  return 0;
}
