#include <bits/stdc++.h>
using namespace std;
int n, c;
string str[310];
pair<unsigned long long, int> ara[310];
pair<unsigned long long, int> hashVal(string str) {
  unsigned long long ret = 0, ba = 1;
  for (auto ch : str) {
    unsigned long long x = ch - 'a';
    x++;
    ret += (x * ba);
    ba *= 31;
  }
  return make_pair(ret, str.size());
}
vector<pair<int, int> > mat[310];
int dp[310][310];
int solve() {
  for (int pos = 0; pos <= n - 1; pos++)
    for (auto x : mat[pos])
      for (int i = 0; i <= n - 1; i++) {
        if (!i)
          dp[pos][i + 1] = max(dp[pos][i + 1], x.second);
        else
          dp[pos][i + 1] = max(dp[pos][i + 1], min(dp[x.first][i], x.second));
      }
  int ret = 0;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++) ret = max(ret, dp[i][j] * (j + 1));
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  int prin = 0;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> str[i];
    ara[i] = hashVal(str[i]);
    c += ara[i].second;
    if (i != n - 1) c++;
  }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = i + 1; j <= n - 1; j++) {
      int x = i, y = j, z = 0;
      while (x < j && y < n) {
        if (str[x] == str[y]) {
          if (x != i) z++;
          z += (ara[x].second - 1);
        } else
          break;
        x++;
        y++;
      }
      mat[j].push_back(make_pair(i, z));
    }
  }
  cout << c - solve() << endl;
  return 0;
}
