#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
enum { MOD0 = 1000000000, MOD7 = 1000000007, MOD9 = 1000000009 };
int n;
string s[300];
bool eq[300][300];
int eqs[300][300];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  int sum = n - 1;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    sum += s[i].size();
  }
  for (int i = 0; i < n; ++i) {
    eq[i][i] = true;
    for (int j = i + 1; j < n; ++j) {
      if (s[i] == s[j]) {
        eq[i][j] = eq[j][i] = true;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      int k = 0;
      while (j + k < n && eq[i + k][j + k]) ++k;
      eqs[i][j] = k;
    }
  }
  int ans = sum;
  for (int i = 0; i < n; ++i) {
    int sum_len = 0;
    int mx = 0;
    for (int j = 0; j < n; ++j) {
      sum_len += s[i + j].size();
      int cur_mx = 1;
      for (int k = i + j + 1; k < n; ++k) {
        if (eqs[i][k] >= j + 1) {
          ++cur_mx;
          k += j;
        }
      }
      if (cur_mx > 1) ans = min(ans, sum - cur_mx * (sum_len - 1));
    }
  }
  cout << ans << '\n';
  return 0;
}
