#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int type = 26;
char s[N];
int n, m, k;
struct node {
  int next[type], num;
} trie[N];
priority_queue<int> slen[N];
int ans, ct, tot;
int makenode() {
  tot++;
  memset(&trie[tot], 0, sizeof(trie[tot]));
  return tot;
}
void init() {
  tot = -1;
  makenode();
  ans = 0;
  return;
}
void add(char *s) {
  int now = 0, p;
  int len = strlen(s);
  for (int i = 0; s[i]; i++) {
    p = s[i] - 'a';
    if (!trie[now].next[p]) trie[now].next[p] = makenode();
    now = trie[now].next[p];
  }
  trie[now].num++;
  return;
}
void dfs(int now, int dep) {
  int p;
  for (int i = 0; i < type; i++) {
    p = trie[now].next[i];
    if (p) {
      dfs(p, dep + 1);
      if (slen[p].size() > slen[now].size()) slen[p].swap(slen[now]);
      while (!slen[p].empty()) {
        slen[now].push(slen[p].top());
        slen[p].pop();
      }
    }
  }
  if (trie[now].num == 0) {
    slen[now].pop();
    slen[now].push(dep);
  } else
    slen[now].push(dep);
  return;
}
int main() {
  scanf("%d", &n);
  init();
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    add(s);
  }
  for (int i = 0; i < type; i++)
    if (trie[0].next[i]) {
      k = trie[0].next[i];
      dfs(k, 1);
      while (!slen[k].empty()) {
        ans += slen[k].top();
        slen[k].pop();
      }
    }
  printf("%d\n", ans);
  return 0;
}
