#include <bits/stdc++.h>
using namespace std;
string words[305];
int match[305][305];
int dp[305][305];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  int sz = n - 1;
  for (int i = 0; i < n; ++i) {
    cin >> words[i];
    sz += words[i].size();
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      match[i][j] = words[i] == words[j];
    }
  }
  int sol = sz;
  for (int i = n - 1; i >= 0; --i) {
    for (int j = i + 1; j < n; ++j) {
      int sum = 0;
      for (int k = 0; i + k < j && j + k < n; ++k) {
        if (!match[i + k][j + k]) break;
        sum += words[i + k].size();
        dp[i][k] = max({dp[i][k], sum - 1 + dp[j][k], 2 * (sum - 1)});
        sol = min(sol, sz - dp[i][k]);
      }
    }
  }
  cout << sol << '\n';
}
