#include <bits/stdc++.h>
using namespace std;
void guan() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int maxn = 200020;
const unsigned long long mod = 1e9 + 7;
const double pi = acos(-1.0);
const unsigned long long maxx = 1LL << 61;
const double eps = 1e-7;
int n, m, x;
inline int read() { return (cin >> n) ? 1 : 0; }
string s[666];
unsigned long long valp[666], vals[666];
int len[666];
void Hash() {
  for (int i = 1; i <= n; i++) {
    unsigned long long sump = 0, sums = 0;
    unsigned long long a = 1ll;
    for (int j = 0, k = s[i].length() - 1; j < s[i].length(); j++, k--) {
      sump = (sump + a * (s[i][j] - 'a' + 2)) % mod;
      sums = (sums + a * (s[i][k] - 'a' + 1)) % mod;
      a = a * 26ll % mod;
    }
    valp[i] = sump;
    vals[i] = sums;
  }
}
void solve() {
  int sumlen = -1;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    len[i] = s[i].length();
    sumlen += len[i] + 1;
  }
  Hash();
  int maxx = 0, maxnum = 0;
  for (int len = 1; len <= n; ++len) {
    for (int i = 1; i <= n; ++i) {
      int sum = -1, num = 1;
      for (int j = 0; j < len; j++) sum += s[i + j].length() + 1;
      for (int k = i + len; k + len - 1 <= n; ++k) {
        int ok = 1;
        for (int q = 0; q < len && ok; ++q) {
          if (vals[i + q] != vals[k + q]) ok = 0;
        }
        if (ok) num++, k += len - 1;
      }
      if (num > 1) maxx = max(maxx, sum * num - num * len);
    }
  }
  cout << sumlen - maxx << endl;
}
int main() {
  guan();
  int t = 1;
  while (t--) {
    while (read()) solve();
  }
  return 0;
}
