#include <bits/stdc++.h>
using namespace std;
int cnt = 1;
const int N = 1e5 + 123;
void load() {
  cin.tie(0);
  cout.tie(0);
}
struct Node {
  int Num, Next[26];
} tree[N];
multiset<int> ss[N];
multiset<int>::iterator it;
void Add(string &x) {
  int tmp = 1;
  for (int i = 0; i < x.size(); ++i) {
    int v = x[i] - 'a';
    if (tree[tmp].Next[v] == 0) tree[tmp].Next[v] = ++cnt;
    tmp = tree[tmp].Next[v];
  }
  ++tree[tmp].Num;
  return;
}
void Dfs(int u, int high) {
  for (int i = 0; i <= 25; ++i) {
    int v = tree[u].Next[i];
    if (!v) continue;
    Dfs(v, high + 1);
    if (ss[v].size() > ss[u].size()) swap(ss[u], ss[v]);
    for (it = ss[v].begin(); it != ss[v].end(); it++) {
      ss[u].insert(*it);
    }
    ss[v].clear();
  }
  if (tree[u].Num == 0 && ss[u].size() > 0) {
    it = ss[u].end();
    --it;
    ss[u].erase(it);
    ss[u].insert(high);
  } else
    ss[u].insert(high);
  return;
}
void process() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    string x;
    cin >> x;
    Add(x);
  }
  tree[1].Num = 1;
  Dfs(1, 0);
  int ans = 0;
  for (it = ss[1].begin(); it != ss[1].end(); ++it) ans += (*it);
  cout << ans;
  return;
}
int main() {
  load();
  process();
  return 0;
}
