#include <bits/stdc++.h>
using namespace std;
const int N = 302, M = 1e5 + 100;
bool dp[N][N][N];
int n;
string arr[N];
char str[M];
int tot;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf(" %s", str);
    arr[i] = str;
    tot += arr[i].size();
    if (i) tot++;
  }
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) dp[i][j][1] = (arr[i] == arr[j]);
  for (int len = 2; len <= n; len++)
    for (int i = 0; i < n; i++)
      for (int j = i + 2; j < n; j++) {
        dp[i][j][len] = ((i + len - 1 < j) && (j + len - 1 < n) &&
                         dp[i][j][len - 1] && dp[i + len - 1][j + len - 1][1]);
      }
  int out = tot;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = i; j < n; j++) {
      sum += arr[j].size();
      int cnt = 1, s = j + 1, len = j - i + 1;
      while (s < n) {
        if (dp[i][s][len])
          cnt++, s += len;
        else
          s++;
      }
      if (cnt == 1) continue;
      int seg = sum + j - i;
      int nseg = j - i + 1;
      out = min(out, tot - seg * cnt + nseg * cnt);
    }
  }
  cout << out << endl;
}
