#include <bits/stdc++.h>
using namespace std;
const long long N = 310;
long long n, res, ans, dp[N][N];
bool f[N][N];
string s[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  res = n - 1;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    res += s[i].size();
  }
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++) f[i][j] = f[j][i] = (s[i] == s[j]);
  for (int i = n; i > 0; i--)
    for (int j = n; j > 0; j--)
      if (f[i][j]) {
        if (i + 1 <= n && j + 1 <= n)
          dp[i][j] = dp[i + 1][j + 1] + 1;
        else
          dp[i][j] = 1;
      }
  ans = res;
  for (int i = 1; i <= n; i++) {
    int sum = 0;
    for (int j = 0; i + j <= n; j++) {
      int cnt = 1;
      sum += s[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, res - sum * cnt - (j * cnt) + cnt * (j + 1));
    }
  }
  cout << ans;
  return 0;
}
