#include <bits/stdc++.h>
using namespace std;
double const EPS = 1e-12, PI = acos(-1);
const int N = 1e3 + 9, M = 5e3 + 9, OO = 1e9 + 7, MOD = 1e9 + 7;
const long long inf = 1e18;
string str[N];
bool isEqu[N][N];
int dp[N][N];
int main() {
  cout << fixed << setprecision(12), ios::sync_with_stdio(false),
      cin.tie(nullptr), cout.tie(nullptr);
  int n;
  cin >> n;
  int sum = n - 1;
  for (int i = 0; i < n; ++i) cin >> str[i], sum += str[i].size();
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      if (str[i] == str[j]) isEqu[i][j] = isEqu[j][i] = 1;
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    for (int j = n - 1; j >= 0; --j) {
      if (!isEqu[i][j]) continue;
      if (i < n - 1 && j < n - 1) dp[i][j] = dp[i + 1][j + 1];
      dp[i][j]++;
    }
  }
  int ans = sum;
  for (int i = 0; i < n; ++i) {
    for (int len = 0; len < n - i; ++len) {
      int cnt = 1;
      for (int j = i + len + 1; j < n; ++j) {
        if (dp[i][j] > len) {
          ++cnt;
          j += len;
        }
      }
      if (cnt == 1) continue;
      int cur = sum, segLen = 0;
      for (int j = i; j <= i + len; ++j) segLen += (str[j].size());
      cur -= segLen * cnt + (len)*cnt;
      cur += (len + 1) * cnt;
      ans = min(ans, cur);
    }
  }
  cout << ans;
  return 0;
}
