#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;
  pair<int, int> arr[300 + 5];
  map<string, int> M;
  int textSize = n - 1;
  for (int i = 1, cnt = 0; i <= n; i++) {
    string s;
    cin >> s;
    if (M[s] == 0) M[s] = ++cnt;
    arr[i] = make_pair(M[s], (int)s.size());
    textSize += arr[i].second;
  }
  int res = textSize;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j + i <= n; j++) {
      int st = j - i + 1, cnt = 1;
      for (int k = j + 1; k + i - 1 <= n; k++) {
        bool flag = true;
        for (int l = 0; st + l <= j && flag; l++) {
          if (arr[st + l].first != arr[k + l].first) {
            flag = false;
          }
        }
        if (flag) {
          ++cnt;
          k += i - 1;
        }
      }
      if (cnt >= 2) {
        int save = (i - 1) * cnt;
        for (int k = j - i + 1; k <= j; k++) save += (arr[k].second - 1) * cnt;
        res = min(res, textSize - save);
      }
    }
  }
  cout << res << "\n";
  return 0;
}
