#include <bits/stdc++.h>
using namespace std;
const int N = 305;
int a[N], l[N];
string s[N];
vector<string> h;
set<vector<int> > c;
map<string, vector<int> > b;
map<vector<int>, vector<int> > d;
map<vector<int>, int> how_many_will_die;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    h.push_back(s[i]);
    b[s[i]].push_back(i);
    l[i] = s[i].length();
  }
  sort(h.begin(), h.end());
  h.erase(unique(h.begin(), h.end()), h.end());
  for (int i = 0; i < h.size(); i++) {
    for (int j : b[h[i]]) {
      a[j] = i + 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    vector<int> cur;
    int cur_length = 0;
    for (int j = i; j <= n; j++) {
      cur.push_back(a[j]);
      cur_length += l[j];
      if (j - i >= 1) cur_length++;
      c.insert(cur);
      d[cur].push_back(i);
      how_many_will_die[cur] = cur_length - (j - i + 1);
    }
  }
  int ans = n - 1;
  for (int i = 1; i <= n; i++) ans += l[i];
  int init = ans;
  for (auto it = c.begin(); it != c.end(); it++) {
    vector<int> cur = *it;
    if (d[cur].size() < 2) continue;
    int cnt = 1, prev = d[cur][0];
    for (int i = 1; i < d[cur].size(); i++) {
      if (d[cur][i] >= prev + cur.size()) {
        cnt++;
        prev = d[cur][i];
      }
    }
    if (cnt >= 2) ans = min(ans, init - cnt * how_many_will_die[cur]);
  }
  cout << ans;
}
