#include <bits/stdc++.h>
using namespace std;
inline long long max(long long x, long long y) { return x > y ? x : y; }
inline long long min(long long x, long long y) { return x < y ? x : y; }
inline long long read() {
  long long x = 0;
  int ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, ans, a[100010];
string s[100010];
inline void solve(int dep, int l, int r) {
  int L = l, R, Max = 0, id;
  while (a[L] < dep && L <= r) L++;
  if (L > r) return;
  if (L == r) {
    a[L] = dep;
    return;
  }
  while (L <= r) {
    R = L;
    while (s[L][dep - 1] == s[R][dep - 1] && R <= r) R++;
    R--, solve(dep + 1, L, R);
    if (a[L] != dep || L == R) {
      Max = 0;
      for (register int i = (L); i <= (R); i++)
        if (a[i] > Max) Max = a[i], id = i;
      if (Max) a[id] = dep;
    }
    L = R + 1;
  }
}
int main() {
  n = read();
  for (register int i = (1); i <= (n); i++) cin >> s[i];
  sort(s + 1, s + 1 + n);
  for (register int i = (1); i <= (n); i++) a[i] = s[i].length();
  solve(1, 1, n);
  for (register int i = (1); i <= (n); i++) ans += a[i];
  printf("%d", ans);
}
