#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const bool debugger1 = 0;
const bool debugger2 = 0;
const bool debugger3 = 0;
const bool debugger4 = 1;
const bool debugger5 = 1;
const int N = 500;
int n;
bool sim[N][N];
int dp[N][N];
string text[N];
int dltxt;
int main() {
  scanf("%d", &n);
  dltxt = n - 1;
  for (int i = 0; i < n; i++) cin >> text[i], dltxt += text[i].size();
  for (int i = 0; i < n; i++) {
    sim[i][i] = 1;
    for (int j = 0; j < i; j++) {
      sim[i][j] = sim[j][i] = text[i] == text[j];
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = n - 1; j >= 0; j--) {
      if (sim[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 = dltxt;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; i + j < n; j++) {
      sum += text[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 = dltxt - sum * cnt + (j + 1) * cnt - j * cnt;
      if (cnt > 1 && ans > cur) ans = cur;
    }
  }
  printf("%d", ans);
  return 0;
}
