#include <bits/stdc++.h>
using namespace std;
string arr[306];
int pos[306];
string comp = "";
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int m = -1;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    m += arr[i].size() + 1;
    comp += arr[i];
    comp += " ";
    pos[i] = comp.size();
  }
  int mx = 0;
  for (int i = 0; i < n; ++i) {
    string s = "";
    for (int j = i; j < (n + i) / 2; ++j) {
      s += arr[j];
      s += " ";
      int size = j - i + 1;
      int x = j;
      int start = pos[x++], freq = 1;
      while (x + size <= n) {
        bool c = 1;
        for (int k = start; k < start + s.size(); ++k) {
          if (s[k - start] != comp[k]) {
            c = 0;
            break;
          }
        }
        if (c) {
          start += s.size();
          freq++;
          x += size;
        } else
          start = pos[x++];
        if (start > m) break;
      }
      if (freq < 2) continue;
      int z = freq * (s.size() - 1 - (size));
      mx = max(mx, z);
    }
  }
  cout << m - mx << endl;
  return 0;
}
