#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, o = 0, a[302] = {}, b[302] = {}, z = -1, y = 0;
  map<string, int> m;
  string s[302] = {};
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n; i++) {
    if (!m[s[i]]) m[s[i]] = ++o;
    a[i] = m[s[i]];
    b[i] = (int)s[i].length();
    z += b[i] + 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j + i <= n; j++) {
      vector<int> c;
      for (int k = j + i; k + i - 1 <= n; k++) {
        bool d = 0;
        for (int l = k; l < k + i; l++)
          if (a[l] != a[j + l - k]) {
            d = 1;
          }
        if (!d) c.push_back(k);
      }
      if (c.empty()) continue;
      int m = 0, x = 1, e = i - 1;
      for (int k = 0; k < c.size(); k++) {
        if (c[k] - m >= i) m = c[k], x++;
      }
      for (int k = j; k < j + i; k++) e += b[k];
      y = max(y, x * (e - i));
    }
  }
  cout << z - y;
}
