#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n;
  cin >> n;
  string wr[n];
  for (int i = 0; i < n; i++) {
    cin >> wr[i];
  }
  map<string, int> mym;
  map<int, int> rm;
  int a[n];
  int ct = 1;
  for (int i = 0; i < n; i++) {
    if (mym.find(wr[i]) != mym.end()) {
      a[i] = mym[wr[i]];
    } else {
      a[i] = ct;
      mym[wr[i]] = ct;
      rm[ct] = wr[i].size();
      ct++;
    }
  }
  int dp[n + 1][n + 1];
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i < n + 1; i++) {
    for (int j = i + 1; j < n + 1; j++) {
      if (a[i - 1] == a[j - 1] && (j - i) > dp[i - 1][j - 1]) {
        dp[i][j] = dp[i - 1][j - 1] + 1;
      }
    }
  }
  int mx = 0;
  int sm[n + 1];
  sm[0] = 0;
  for (int i = 0; i < n; i++) {
    mx += wr[i].size();
    sm[i + 1] = mx;
  }
  mx += (n - 1);
  int ans = mx;
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < n + 1; j++) {
      int tm = mx - (sm[i] - sm[i - j]) - (j - 1) + j;
      int st = i + j;
      bool fl = false;
      while (st <= n) {
        if (dp[i][st] >= j) {
          tm -= (sm[st] - sm[st - j]) + (j - 1) - j;
          fl = true;
          st = st + j;
        } else {
          st += 1;
        }
      }
      if (fl) {
        if (ans > tm) {
          ans = tm;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
