#include <bits/stdc++.h>
using namespace std;
const long long N = 3e2 + 10, M = 1e7, eps = 1e-7, MOD = 1e9 + 7;
long long n, id = 1;
map<string, long long> mapa;
map<long long, string> odmapa;
long long tab[N], dl[N];
long long dp[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (mapa[s] == 0) {
      mapa[s] = id;
      odmapa[id++] = s;
    }
    if (i != 0) dl[i] += dl[i - 1];
    dl[i] += s.size();
    tab[i] = mapa[s];
  }
  for (long long i = n - 2; i >= 0; i--) {
    for (long long j = n - 1; j > i; j--) {
      if (tab[i] == tab[j])
        dp[i][j] = dp[i + 1][j + 1] + 1;
      else
        dp[i][j] = 0;
    }
  }
  long long wyn = dl[n - 1];
  for (long long i = 0; i < n - 1; i++) {
    for (long long j = 1; j < n; j++) {
      long long wsk = i + j, cunt = 1;
      while (wsk < n) {
        if (dp[i][wsk] >= j) {
          cunt++;
          wsk += j;
        } else
          wsk++;
      }
      long long zysk = dl[i + j - 1];
      if (i != 0) zysk -= dl[i - 1];
      zysk -= 1;
      if (cunt != 1) wyn = min(wyn, dl[n - 1] - cunt * zysk);
    }
  }
  cout << wyn + n - 1;
}
