#include <bits/stdc++.h>
using namespace std;
vector<string> v;
int f[1000];
void build(vector<string> &s) {
  int len = 0;
  f[0] = 0;
  for (int i = 1; i < s.size(); ++i) {
    while (len > 0 && s[i] != s[len]) len = f[len - 1];
    if (s[i] == s[len]) ++len;
    f[i] = len;
  }
}
int search(vector<string> &s) {
  int ret = 0;
  build(s);
  int len = 0;
  for (int i = 0; i < v.size(); ++i) {
    while (len > 0 && v[i] != s[len]) len = f[len - 1];
    if (v[i] == s[len]) ++len;
    if (len == s.size()) {
      ret++;
      len = 0;
    }
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int m = -1;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    v.push_back(s);
    m += s.size() + 1;
  }
  int mx = 0;
  for (int i = 0; i < n; ++i) {
    vector<string> s;
    int m = -1;
    for (int j = i; j < (n + i) / 2; ++j) {
      s.push_back(v[j]);
      m += v[j].size() + 1;
      int freq = search(s);
      if (freq < 2) continue;
      int z = freq * m - freq * s.size();
      mx = max(mx, z);
    }
  }
  cout << m - mx << endl;
  return 0;
}
