#include <bits/stdc++.h>
long long q_pow(long long x, long long n, long long mod) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = x * ret % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return ret;
}
long long __gcd(long long x, long long y) {
  if (!y) return x;
  return __gcd(y, x % y);
}
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
using namespace std;
const long long INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 100010 + 50;
priority_queue<int> que[maxn];
int trie[maxn][27];
int cnt, ans;
int vis[maxn];
char s[maxn];
void insert(char *s) {
  int rt = 0;
  int len = strlen(s);
  for (int i = 0; i < len; i++) {
    int id = s[i] - 'a';
    if (trie[rt][id] == 0) trie[rt][id] = ++cnt;
    rt = trie[rt][id];
  }
  vis[rt] = 1;
  ans += len;
  que[rt].push(len);
}
void dfs(int pos, int dep) {
  int tmp, to;
  for (int i = 0; i < 26; i++) {
    if (trie[pos][i] != 0) {
      to = trie[pos][i];
      dfs(to, dep + 1);
      while (!que[to].empty()) {
        tmp = que[to].top();
        que[to].pop();
        que[pos].push(tmp);
      }
    }
  }
  if (pos != 0 && !vis[pos]) {
    ans -= que[pos].top() - dep;
    que[pos].pop();
    que[pos].push(dep);
  }
}
signed main(int argc, char *argv[]) {
  if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    insert(s);
  }
  dfs(0, 0);
  cout << ans << endl;
  return 0;
}
