#include <bits/stdc++.h>
#pragma optimize("Ofast")
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar(' ');
}
vector<int> s(505, 0);
struct hash {
  unsigned long long mod, sed, base[505], sum[505];
  int n;
} hashs[2];
string a[505];
map<string, int> mapp;
vector<int> length(505, 0), lep(505, 0);
map<pair<pair<unsigned long long, unsigned long long>, int>, int> myid;
int n;
unsigned long long xx[2] = {146527, 19260817};
unsigned long long yy[2] = {998244353, 1000000009};
void adds(int qq, int x, int y) {
  hashs[qq].sed = xx[x];
  hashs[qq].mod = yy[y];
  hashs[qq].base[0] = 1;
  for (int i = 1; i <= n; i++) {
    hashs[qq].base[i] = hashs[qq].base[i - 1] * hashs[qq].sed % hashs[qq].mod;
    hashs[qq].sum[i] =
        (hashs[qq].sum[i - 1] * hashs[qq].sed % hashs[qq].mod + s[i]) %
        hashs[qq].mod;
  }
}
unsigned long long gethash(int qq, int x, int y) {
  return (hashs[qq].sum[y] -
          hashs[qq].sum[x - 1] * hashs[qq].base[y - x + 1] % hashs[qq].mod +
          hashs[qq].mod) %
         hashs[qq].mod;
}
int main() {
  int cnt = 0, tot = 0;
  cin >> n;
  memset(hashs, 0, sizeof(hashs));
  for (int i = 0; i < 2; i++) hashs[i].n = n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    length[i] = a[i].size();
    if (!mapp[a[i]]) {
      mapp[a[i]] = ++cnt;
    }
    s[i] = mapp[a[i]];
    lep[i] = lep[i - 1] + length[i];
  }
  adds(0, 0, 0);
  adds(1, 1, 1);
  int ans = lep[n] + n - 1;
  vector<vector<int>> pos(505 * 505, vector<int>());
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      unsigned long long hash1 = gethash(0, i, j), hash2 = gethash(1, i, j);
      int len = j - i + 1;
      pair<pair<unsigned long long, unsigned long long>, int> tmp = {
          {hash1, hash2}, len};
      if (myid[tmp] == 0) myid[tmp] = ++tot;
      pos[myid[tmp]].push_back(i);
    }
  }
  int maxx = 0;
  for (map<pair<pair<unsigned long long, unsigned long long>, int>,
           int>::iterator i = myid.begin();
       i != myid.end(); i++) {
    int tmp = i->first.second;
    int tmpp = i->second, cntt = 0, last = -0x3f3f3f3f;
    sort(pos[tmpp].begin(), pos[tmpp].end());
    for (auto &ii : pos[tmpp]) {
      if (ii >= last + tmp) {
        last = ii;
        cntt++;
      }
    }
    if (cntt != 1) {
      maxx =
          max(maxx,
              (lep[pos[tmpp][0] + tmp - 1] - lep[pos[tmpp][0] - 1] - 1) * cntt);
    }
  }
  cout << ans - maxx << endl;
  return 0;
}
