#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ch = getchar(), f = 1, ans = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = 0;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    ans = (((ans << 2) + ans) << 1) + (ch ^ '0');
  return f ? ans : -ans;
}
int n;
map<string, int> m;
int cnt;
const int maxn = 305;
int a[maxn];
int len[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    if (!m.count(s)) {
      m[s] = ++cnt;
    }
    a[i] = m[s];
    len[i] = s.length();
    ans += len[i];
  }
  ans += n - 1;
  int minn = ans;
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; ++j) {
      int lenth = j - i + 1;
      int cnt = 1;
      int now = j + 1;
      for (int k = j + 1; k + lenth - 1 <= n; ++k) {
        if (k != now) continue;
        bool flag = 0;
        for (int l = 0; l < lenth; ++l) {
          if (a[i + l] != a[k + l]) {
            flag = 1;
            break;
          }
        }
        if (!flag)
          ++cnt, now = k + lenth;
        else
          now++;
      }
      if (cnt == 1) continue;
      int str = 0;
      for (int k = i; k <= j; ++k) str += len[k];
      minn = min(minn, ans - (str + (lenth - 1)) * cnt + lenth * cnt);
    }
  }
  cout << minn << endl;
  return 0;
}
