#include <bits/stdc++.h>
using namespace std;
string capital(char c) {
  long long x = toupper(c);
  string l;
  l += (char)x;
  return l;
}
const long long N = 303;
long long n;
bool eq[N][N];
long long dp[N][N];
string s[N];
void solve() {
  cin >> n;
  long long allsum = n - 1;
  for (long long i = 0; i < n; ++i) {
    cin >> s[i];
    allsum += s[i].size();
  }
  for (long long i = 0; i < n; ++i) {
    eq[i][i] = true;
    for (long long j = 0; j < i; ++j) {
      eq[i][j] = eq[j][i] = s[i] == s[j];
    }
  }
  for (long long i = n - 1; i >= 0; --i) {
    for (long long j = n - 1; j >= 0; --j) {
      if (eq[i][j]) {
        if (i + 1 < n && j + 1 < n)
          dp[i][j] = dp[i + 1][j + 1] + 1;
        else
          dp[i][j] = 1;
      }
    }
  }
  long long ans = allsum;
  for (long long i = 0; i < n; ++i) {
    long long sum = 0;
    for (long long j = 0; i + j < n; ++j) {
      sum += s[i + j].size();
      long long cnt = 1;
      for (long long pos = i + j + 1; pos < n; ++pos) {
        if (dp[i][pos] > j) {
          ++cnt;
          pos += j;
        }
      }
      long long cur = allsum - sum * cnt + (j + 1) * cnt - j * cnt;
      if (cnt > 1 && ans > cur) {
        ans = cur;
      }
    }
  }
  cout << ans << endl;
  return;
}
int32_t main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
