#include <bits/stdc++.h>
using namespace std;
const int maxn = 305;
string str[maxn];
int n;
int len[maxn];
long long ha[maxn], ha2[maxn], power[100005], power2[100005];
long long base = 133, base2 = 1e9 + 7, mod = 1998585857;
bool check(int p1, int p2, int p3, int p4) {
  long long h1 =
      (ha[p4] - ha[p3 - 1] * power[len[p4] - len[p3 - 1]] % mod + mod) % mod;
  long long h2 =
      (ha[p2] - ha[p1 - 1] * power[len[p2] - len[p1 - 1]] % mod + mod) % mod;
  if (h1 == h2) {
    h1 = ha2[p4] - ha2[p3 - 1] * power2[p4 - p3 + 1];
    h2 = ha2[p2] - ha2[p1 - 1] * power2[p2 - p1 + 1];
    return h1 == h2;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  power[0] = 1;
  power2[0] = 1;
  for (int i = 1; i < 100005; i++) {
    power[i] = power[i - 1] * base % mod;
    power2[i] = power2[i - 1] * base2;
  }
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> str[i];
    ha[i] = ha[i - 1];
    ha2[i] = ha2[i - 1] * base2 + str[i].length();
    len[i] = len[i - 1] + str[i].length();
    for (int j = 0; j < str[i].length(); j++) {
      ha[i] = (ha[i] * base + 1LL * str[i][j]) % mod;
    }
  }
  int ans = 0;
  for (int l = 1; l <= n; l++) {
    for (int i = 1; i + l - 1 <= n; i++) {
      int temp = 0, pos = 1, cnt = 0;
      while (pos + l - 1 <= n) {
        if (pos + l - 1 >= i && pos <= i) {
          pos = i + l;
          continue;
        }
        if (check(i, i + l - 1, pos, pos + l - 1)) {
          cnt++;
          pos = pos + l;
        } else {
          pos++;
        }
      }
      if (cnt) {
        cnt++;
        ans = max(ans, cnt * (len[i + l - 1] - len[i - 1] - 1));
      }
    }
  }
  ans = len[n] + n - 1 - ans;
  cout << ans << endl;
  return 0;
}
