#include <bits/stdc++.h>
using namespace std;
string a[310];
int b[310];
long long c[310];
const long long SEED = 131;
const long long MOD = 1e9 + 7;
const long long MAXN = 100010;
void kmp_pre(int x[], int m, int Next[]) {
  int i, j;
  j = Next[0] = -1;
  i = 0;
  while (i < m) {
    while (-1 != j && x[i] != x[j]) j = Next[j];
    Next[++i] = ++j;
  }
}
int Next[310], vis[310];
int KMP_Count(int x[], int m, int y[], int n) {
  int i, j;
  int ret = 0;
  kmp_pre(x, m, Next);
  memset(vis, 0, sizeof(vis));
  i = j = 0;
  while (i < n) {
    while (-1 != j && y[i] != x[j]) j = Next[j];
    i++;
    j++;
    if (j >= m) {
      vis[i] = 1;
      j = Next[j];
    }
  }
  for (int i = 0; i <= n; i++)
    if (vis[i]) {
      ret++;
      i += m - 1;
    }
  return ret;
}
int main() {
  int n;
  int x[310], y[310];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) b[i] = b[i - 1] + a[i - 1].size();
  for (int i = 0; i < n; i++) {
    long long x = 0;
    for (int j = 0; j < (int)a[i].size(); j++) x = (x * SEED + a[i][j]) % MOD;
    c[i] = x;
  }
  long long ans, sum;
  ans = b[n - 1] + a[n - 1].size() + n - 1;
  sum = b[n - 1] + a[n - 1].size() + n - 1;
  for (int i = 0; i < n; i++)
    for (int j = i; j < n; j++) {
      for (int k = i; k <= j; k++) x[k - i] = c[k];
      for (int k = j + 1; k < n; k++) y[k - j - 1] = c[k];
      int ret = KMP_Count(x, j - i + 1, y, n - j - 1);
      if (ret) {
        ans = min(ans,
                  sum - (ret + 1) * (b[j] - b[i] + (long long)a[j].size() - 1));
      }
    }
  printf("%lld\n", ans);
  return 0;
}
