#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const double pi = acos(-1);
const int maxx = 100005;
int trie[maxx][26];
int nxt = 1, ans, n;
multiset<int> finish[maxx];
void Add(string s) {
  int node = 0;
  for (int i = 0; i < ((long long int)(s).size()); i++) {
    if (trie[node][s[i] - 'a'] == 0) {
      node = trie[node][s[i] - 'a'] = nxt;
      nxt++;
    } else {
      node = trie[node][s[i] - 'a'];
    }
  }
  finish[node].insert(((long long int)(s).size()));
}
void dfs(int now, int deep = 0) {
  bool can = (finish[now].empty() && deep != 0);
  for (long long int i = 0; i < 26; i++) {
    if (trie[now][i]) {
      int nxt = trie[now][i];
      dfs(nxt, deep + 1);
      if (((long long int)(finish[nxt]).size()) >
          ((long long int)(finish[now]).size())) {
        finish[now].swap(finish[nxt]);
      }
      for (auto i : finish[nxt]) {
        finish[now].insert(i);
      }
    }
  }
  if (can) {
    finish[now].erase((--finish[now].end()));
    finish[now].insert(deep);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  string s;
  for (long long int i = 0; i < n; i++) {
    cin >> s;
    Add(s);
  }
  dfs(0);
  for (auto i : finish[0]) ans += i;
  cout << ans << '\n';
  return 0;
}
