#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1123456;
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
void vout(T s) {
  cout << s << "\n";
  exit(0);
}
long long bp(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
map<string, long long> mp;
unsigned long long hs[300][300], p = 307;
long long len[300][300];
long long dp[MAXN];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  long long n, sum, ans;
  cin >> n;
  sum = n - 1;
  vector<string> a(n);
  vector<long long> b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (mp.find(a[i]) == mp.end()) mp[a[i]] = mp.size() + 1;
    b[i] = mp[a[i]];
    sum += a[i].size();
  }
  ans = sum;
  for (int i = 0; i < n; i++) {
    long long p1 = 1, hss = 0, ln = 0;
    for (int j = i; j < n; j++) {
      hss = (hss + p1 * b[j]);
      hs[i][j] = hss;
      ln += a[j].size() - 1;
      if (j - i + 1 > 1) ln++;
      p1 = (p * p1);
      len[i][j] = ln;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      for (int i1 = 1; i1 <= n; i1++) dp[i1] = 0;
      long long k = j - i + 1;
      for (int i1 = k; i1 <= n; i1++) {
        dp[i1] = dp[i1 - 1];
        if (hs[i1 - k][i1 - 1] == hs[i][j]) dp[i1] = dp[i1 - k] + 1;
      }
      if (dp[n] > 1) {
        ans = min(ans, sum - dp[n] * len[i][j]);
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
