#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void umin(T &a, T b) {
  a = min(a, b);
}
template <class T>
inline void umax(T &a, T b) {
  a = max(a, b);
}
const int INF = 0x3f3f3f3f;
long long mod = 1e9 + 7;
const int N = 100005;
char s[N];
struct Trie {
  static const int maxnode = 100005;
  static const int sigma_size = 26;
  int ch[maxnode][sigma_size];
  int val[maxnode];
  int p[maxnode];
  int d[maxnode], ms[maxnode];
  priority_queue<int> q[maxnode];
  int sz;
  void clear() {
    sz = 1;
    memset(ch[0], 0, sizeof(ch[0]));
  }
  int idx(char c) { return c - 'a'; }
  void insert(const char *s, int v) {
    int u = 0, n = strlen(s);
    for (int i = 0; i < n; i++) {
      int c = idx(s[i]);
      if (!ch[u][c]) {
        memset(ch[sz], 0, sizeof(ch[sz]));
        val[sz] = 0;
        ch[u][c] = sz++;
        d[ch[u][c]] = d[u] + 1;
      }
      p[ch[u][c]] = u;
      u = ch[u][c];
    }
    val[u] = v;
  }
  void dfs(int u) {
    for (int i = 0; i < 26; i++) {
      int v = ch[u][i];
      if (v) {
        dfs(v);
        while (!q[v].empty()) {
          q[u].push(q[v].top());
          q[v].pop();
        }
      }
    }
    if (u == 0) return;
    if (val[u] == 0) {
      q[u].pop();
      q[u].push(d[u]);
    } else {
      q[u].push(d[u]);
    }
  }
  int solve() {
    dfs(0);
    int ans = 0;
    while (!q[0].empty()) {
      ans += q[0].top();
      q[0].pop();
    }
    return ans;
  }
} wc;
int main() {
  int n;
  scanf("%d", &n);
  wc.clear();
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    wc.insert(s, 1);
  }
  printf("%d\n", wc.solve());
  return 0;
}
