#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int main() {
  int n, id = 0;
  cin >> n;
  vector<int> a(n + 1), b(n + 1);
  for (int i = 1; i <= n; i++) {
    string tmp;
    cin >> tmp;
    if (mp[tmp] == 0) mp[tmp] = ++id;
    a[i] = mp[tmp];
    b[i] = tmp.length() + b[i - 1];
  }
  int cnt = b.back() + n - 1, ans = cnt;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      int len = 1 - (b[j] - b[i - 1]), ct = 0;
      for (int k = j + 1; k + j - i <= n; k++) {
        int flag = 1;
        for (int p = 0; p < j - i + 1; p++) {
          if (a[i + p] != a[k + p]) {
            flag = 0;
            break;
          }
        }
        if (flag) {
          ct++;
          k = k + j - i;
        }
      }
      if (ct) {
        ans = min(ans, cnt + (ct + 1) * len);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
