#include <bits/stdc++.h>
using namespace std;
int n;
long long total, len[300];
pair<long long, long long> hsh[300][300];
vector<long long> words;
map<string, long long> hashmachine;
pair<long long, long long> rollHash(int lo, int hi) {
  pair<long long, long long> res = make_pair(0, 0);
  for (int i = (lo); i < (hi + 1); i++) {
    res.first *= 701;
    res.first += words[i] + 87123;
    res.second *= 1619;
    res.second += words[i] + 23423;
  }
  return res;
}
long long numOcc(int lo, int hi) {
  pair<long long, long long> h = hsh[lo][hi];
  int res = 0, last = -1000;
  for (int i = (hi - lo); i < (n); i++)
    if (hsh[i - hi + lo][i] == h && last < i - hi + lo) {
      last = i;
      res++;
    }
  return (long long)res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < (n); i++) {
    string w;
    cin >> w;
    if (!hashmachine.count(w))
      hashmachine.insert(make_pair(w, ((int)(hashmachine).size())));
    words.push_back(hashmachine[w]);
    len[i] = ((int)(w).size());
  }
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (n); j++) hsh[i][j] = rollHash(i, j);
  total = len[0];
  for (int i = (1); i < (n); i++) total += 1 + len[i];
  long long res = total;
  for (int i = 0; i < (n); i++)
    for (int j = (i); j < (n); j++) {
      long long partLen = len[i];
      for (int k = (i + 1); k < (j + 1); k++) partLen += len[k] + 1;
      long long numWords = j - i + 1;
      long long no = numOcc(i, j);
      if (no > 1) res = min(res, total + no * (numWords - partLen));
    }
  cout << res << endl;
}
