#include <bits/stdc++.h>
using namespace std;
const int N = 305;
const unsigned long long p = 100007;
bool is[N][N];
string s[N];
map<string, int> mp;
int get(string t) {
  if (mp.count(t)) return mp[t];
  return mp[t] = ((int)mp.size() + 1);
}
int id[N];
unsigned long long h[N][N];
int a[N];
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i], id[i] = get(s[i]);
    a[i] = a[i - 1] + (int)s[i].size();
  }
  for (int i = 1; i <= n; i++) {
    h[i][i] = id[i];
    for (int j = i + 1; j <= n; j++) {
      h[i][j] = h[i][j - 1] * p + id[j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      is[i][j] = is[j][i] = (s[i] == s[j]);
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      int cnt = 1, cur = j + 1, len = j - i + 1;
      while (cur + len - 1 <= n) {
        if (h[i][j] == h[cur][cur + len - 1]) {
          cnt++;
          cur += len;
        } else
          cur++;
      }
      int t = a[j] - a[i - 1] + (j - i) - (j - i + 1);
      if (cnt >= 2) {
        ans = max(ans, t * cnt);
      }
    }
  }
  printf("%d\n", a[n] + n - 1 - ans);
}
int main() {
  solve();
  return 0;
}
