#include <bits/stdc++.h>
using namespace std;
int N;
int L[300 + 5], Num[300 + 5];
int Hash(string S) {
  int ret = 0, len = S.length();
  for (int i = 0; i < len; i++) ret = (ret * 59 + S[i]) % 1000000007;
  return ret;
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    string S;
    cin >> S;
    Num[i] = Hash(S);
    L[i] = L[i - 1] + S.length();
  }
  int Ans = L[N] + N - 1;
  for (int i = 1; i <= N; i++)
    for (int j = i; j <= N; j++) {
      int len = j - i + 1, cnt = 1;
      for (int x = j + 1; x <= N; x++) {
        bool flag = 1;
        for (int k = 1; k <= len; k++)
          if (Num[i + k - 1] != Num[x + k - 1]) {
            flag = 0;
            break;
          }
        if (flag) {
          cnt++;
          x += len - 1;
        }
      }
      if (cnt > 1) {
        int tmp = L[N] + N - 1 - cnt * (L[j] - L[i - 1] + len - 1) + cnt * len;
        Ans = min(Ans, tmp);
      }
    }
  printf("%d", Ans);
}
