#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int kc = 0;
int sum[N], val[N], ch[N][26];
int newNode() { return ++kc; }
vector<int> dp[N];
int chAt[26];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int root = newNode();
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    int node = root;
    for (auto it : s) {
      sum[node]++;
      if (not ch[node][it - 'a']) ch[node][it - 'a'] = newNode();
      node = ch[node][it - 'a'];
    }
    sum[node]++;
    val[node] = 1;
  }
  for (int i = kc; i >= 2; i--) {
    dp[i].resize(sum[i] + 1);
    memset(chAt, 0, sizeof chAt);
    int cur = 1;
    int ans = 0;
    while (cur + 1 <= sum[i]) {
      cur++;
      int cnt = N, pos;
      for (int j = 0; j < 26; j++) {
        if (chAt[j] < sum[ch[i][j]]) {
          int inc = dp[ch[i][j]][chAt[j] + 1] - dp[ch[i][j]][chAt[j]];
          if (inc < cnt) {
            cnt = inc;
            pos = j;
          }
        }
      }
      chAt[pos]++;
      ans += cnt + 1;
      dp[i][cur] = ans;
    }
  }
  int ans = sum[root];
  for (int i = 0; i < 26; i++) {
    if (ch[root][i]) ans += dp[ch[root][i]][sum[ch[root][i]]];
  }
  cout << ans << "\n";
  return 0;
}
