#include <bits/stdc++.h>
using namespace std;
struct node {
  node *t[26];
  int end;
  int dep;
  node() {
    for (int i = 0; i < 26; i++) {
      t[i] = NULL;
    }
    end = 0;
    dep = 0;
  }
} * root;
void insert(string s) {
  node *cur = root;
  for (int i = 0; i < s.size(); i++) {
    int c = s[i] - 'a';
    if (cur->t[c] == NULL) {
      cur->t[c] = new node();
    }
    cur = cur->t[c];
    cur->dep = i + 1;
  }
  cur->end = 1;
}
void dfs(node *cur, priority_queue<int> &Q) {
  for (int i = 0; i < 26; i++) {
    if (cur->t[i]) {
      priority_queue<int> P;
      dfs(cur->t[i], P);
      while (!P.empty()) {
        Q.push(P.top());
        P.pop();
      }
    }
  }
  if (cur->end == 0) {
    Q.pop();
    Q.push(cur->dep);
  } else {
    Q.push(cur->dep);
  }
}
char s[100010];
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  root = new node();
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    insert(s);
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    if (root->t[i]) {
      priority_queue<int> Q;
      dfs(root->t[i], Q);
      while (!Q.empty()) {
        ans += Q.top();
        Q.pop();
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
