#include <bits/stdc++.h>
using namespace std;
map<string, int> Q;
int visit[100005], pre[100005];
int main() {
  int n, tot = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    string word;
    cin >> word;
    if (Q.find(word) == Q.end()) {
      visit[i] = ++tot;
      Q[word] = tot;
    } else
      visit[i] = Q[word];
    pre[i] = pre[i - 1] + word.length();
  }
  int ans = pre[n] + n - 1;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++) {
      int d = j - i, t = 0;
      for (int k = j + 1; k + d <= n; k++) {
        bool f = true;
        for (int z = 0; z <= d; z++)
          if (visit[i + z] != visit[k + z]) {
            f = false;
            break;
          }
        if (f) {
          t++;
          k += d;
        }
      }
      if (t) {
        int tmp = pre[n] - (t + 1) * (pre[j] - pre[i - 1]) +
                  (t + 1) * (j - i + 1) + n - 1 - (t + 1) * d;
        ans = min(ans, tmp);
      }
    }
  printf("%d\n", ans);
  return 0;
}
