#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n;
int a[305], len[305];
int sum[305];
int hashh[305];
map<string, int> mp;
int cnt = 0;
int tmp;
int total = 0;
int p[305];
int rnd[305];
int get(int l, int r) {
  int t = (hashh[r] - 1LL * hashh[l - 1] * p[r - l + 1]) % mod;
  t = (t + mod) % mod;
  return t;
}
int dp[305];
int find(int h, int l) {
  memset(dp, 0, sizeof(dp));
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1];
    if (i - l + 1 >= 1 && get(i - l + 1, i) == h) {
      dp[i] = max(dp[i], dp[i - l] + 1);
    }
  }
  return dp[n];
}
int main() {
  scanf("%d", &n);
  tmp = 744774;
  p[0] = 1;
  sum[0] = 0;
  for (int i = 1; i <= n; i++) rnd[i] = i;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    map<string, int>::iterator it = mp.find(s);
    if (it == mp.end()) {
      a[i] = rnd[++cnt];
      mp.insert(pair<string, int>{s, cnt});
    } else
      a[i] = rnd[it->second];
    len[i] = s.size();
    hashh[i] = (1LL * hashh[i - 1] * tmp + a[i]) % mod;
    sum[i] = sum[i - 1] + len[i];
    p[i] = (1LL * p[i - 1] * tmp) % mod;
  }
  for (int i = 1; i <= n; i++) {
    total += len[i];
    if (i > 1) total++;
  }
  int ans = total;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      int qq = get(i, j);
      int r = sum[j] - sum[i - 1] - 1;
      int p = find(qq, j - i + 1);
      if (p > 1) {
        ans = min(ans, total - r * p);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
