#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
bool eq[305][305];
int dp[305][305];
string s[305];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int T;
  T = 1;
  for (int cs = 1; cs <= T; cs++) {
    int n;
    cin >> n;
    int allSum = n - 1;
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      allSum += (int)s[i].size();
    }
    for (int i = 0; i < n; i++) {
      eq[i][i] = true;
      for (int j = 0; j < i; j++) {
        eq[i][j] = eq[j][i] = (s[i] == s[j]);
      }
    }
    for (int i = n - 1; i >= 0; i--) {
      for (int 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;
        }
      }
    }
    int ans = allSum;
    for (int i = 0; i < n; i++) {
      int sum = 0;
      for (int j = 0; i + j < n; j++) {
        sum += s[i + j].size();
        int cnt = 1;
        for (int pos = i + j + 1; pos < n; pos++) {
          if (dp[i][pos] > j) {
            cnt++;
            pos += j;
          }
        }
        int cur = allSum - sum * cnt + (j + 1) * cnt - j * cnt;
        if (cnt > 1 && ans > cur) {
          ans = cur;
        }
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
