#include <bits/stdc++.h>
using namespace std;
const int maxn = 310;
int n, s[maxn], id[maxn], cnt, ans;
map<string, int> mp;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string ss;
    cin >> ss;
    int idd = 0;
    if (!mp[ss])
      mp[ss] = idd = ++cnt;
    else
      idd = mp[ss];
    id[i] = idd;
    s[i] = s[i - 1] + ss.size();
  }
  ans = s[n] + n - 1;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      int d = j - i, cnt_ = 0;
      for (int k = j + 1; k + d <= n; k++) {
        int flag = 1;
        for (int x = 0; x <= d; x++) {
          if (id[i + x] != id[k + x]) {
            flag = 0;
            break;
          }
        }
        if (flag) cnt_++, k += d;
      }
      if (cnt_) {
        int temp = s[n] - (cnt_ + 1) * (s[j] - s[i - 1]) + cnt_ + n;
        ans = min(ans, temp);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
