#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, tot = 0, a[310], ans = 0, sum[310];
map<string, int> m;
string s;
bool check(int i1, int j1, int i2) {
  for (int i = i1, ii = i2; i <= j1; ++i, ++ii)
    if (a[i] != a[ii]) return false;
  return true;
}
int main() {
  sum[0] = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    cin >> s;
    if (m[s] == 0) m[s] = ++tot;
    a[i] = m[s];
    sum[i] = sum[i - 1] + s.size();
  }
  int cur, lenth;
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; ++j) {
      if (n - j < j - i + 1) break;
      lenth = sum[j] - sum[i - 1] - 1;
      cur = lenth;
      for (int l = j + 1; l <= n; ++l) {
        if (l + j - i > n) break;
        if (!check(i, j, l)) continue;
        cur += lenth;
        l = l + j - i;
      }
      if (cur > lenth) ans = max(ans, cur);
    }
  }
  printf("%d\n", sum[n] + n - 1 - ans);
  return 0;
}
