#include <bits/stdc++.h>
using namespace std;
int n, x, siz[100100];
string words[100100];
struct Tnode {
  Tnode *child[26];
  bool isLeaf = false;
  int ind;
  Tnode() {
    for (int i = 0; i < 26; i++) child[i] = NULL;
    ind = x++;
  }
} * trie;
void insertWord(Tnode *root, string s) {
  Tnode *aux = root;
  for (int lvl = 0; lvl < s.size(); lvl++) {
    if (!aux->child[s[lvl] - 'a']) aux->child[s[lvl] - 'a'] = new Tnode();
    aux = aux->child[s[lvl] - 'a'];
  }
  aux->isLeaf = true;
}
int ans = 0;
multiset<int> *vec[100100];
void solve(Tnode *aux, int dep) {
  int mx = -1, bigChild = -1;
  for (int i = 0; i < 26; i++)
    if (aux->child[i] && siz[aux->child[i]->ind] > mx) {
      mx = siz[aux->child[i]->ind];
      bigChild = i;
    }
  for (int i = 0; i < 26; i++)
    if (aux->child[i] && i != bigChild) solve(aux->child[i], dep + 1);
  if (bigChild != -1) {
    solve(aux->child[bigChild], dep + 1);
    vec[aux->ind] = vec[aux->child[bigChild]->ind];
  } else
    vec[aux->ind] = new multiset<int>();
  for (int i = 0; i < 26; i++)
    if (aux->child[i] && i != bigChild)
      for (auto x : *vec[aux->child[i]->ind]) vec[aux->ind]->insert(x);
  if (!aux->isLeaf) {
    ans -= *vec[aux->ind]->rbegin() - dep;
    vec[aux->ind]->erase(vec[aux->ind]->find(*vec[aux->ind]->rbegin()));
  }
  vec[aux->ind]->insert(dep);
}
void dfs(Tnode *aux) {
  siz[aux->ind] = 1;
  for (int i = 0; i < 26; i++)
    if (aux->child[i]) {
      dfs(aux->child[i]);
      siz[aux->ind] += siz[aux->child[i]->ind];
    }
}
int main() {
  scanf("%d", &n);
  x = 1;
  trie = new Tnode();
  for (int i = 0; i < n; i++) {
    cin >> words[i];
    ans += words[i].size();
    insertWord(trie, words[i]);
  }
  dfs(trie);
  for (int i = 0; i < 26; i++)
    if (trie->child[i]) solve(trie->child[i], 0);
  printf("%d\n", ans);
  return 0;
}
