#include <bits/stdc++.h>
using namespace std;
vector<string> v;
int dp[302][302];
int main() {
  ios::sync_with_stdio(0);
  int n, ans = 0;
  cin >> n;
  ans = n - 1;
  v.push_back("abs");
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
    ans += s.size();
  }
  int tot = ans;
  for (int i = n; i >= 1; i--) {
    for (int j = n; j >= 1; j--) {
      if (v[i] == v[j]) dp[i][j] = 1 + dp[i + 1][j + 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    int sm = 0;
    for (int j = 0; i + j <= n; j++) {
      int cnt = 1;
      sm += v[i + j].size();
      for (int k = i + j + 1; k <= n; k++) {
        if (dp[i][k] > j) {
          cnt++;
          k += j;
        }
      }
      if (cnt > 1) ans = min(ans, tot - sm * cnt + cnt);
    }
  }
  cout << ans << endl;
  return 0;
}
