#include <bits/stdc++.h>
using namespace std;
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
void file() {}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}
const int N = 309;
bool same[N][N];
int mx[N][N];
int main() {
  file();
  fast();
  int n, strLen = 0;
  cin >> n;
  vector<string> v1(n);
  for (auto& it : v1) {
    cin >> it;
    strLen += (int)(it.size());
  }
  strLen += n - 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) same[i][j] = v1[i] == v1[j];
  for (int i = n - 1; i >= 0; i--) {
    for (int j = n - 1; j >= 0; j--) {
      if (same[i][j]) mx[i][j] = mx[i + 1][j + 1] + 1;
    }
  }
  int ans = strLen;
  for (int i = 0; i < n; i++) {
    for (int len = 1; i + len <= n; len++) {
      int sum = len - 1, cnt = 1;
      for (int it = i; it < i + len; it++) sum += (int)(v1[it].size());
      for (int j = i + len; j < n; j++) {
        if (mx[i][j] >= len) cnt++, j += len - 1;
      }
      if (cnt >= 2) ans = min(ans, strLen - cnt * sum + cnt * len);
    }
  }
  cout << ans << "\n";
  return 0;
}
