#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int k, n, m;
char s[N];
int f[N], cnt;
int nx[N][26];
int Ans;
char b[N];
priority_queue<pair<int, int> > Q;
int Ins(int x) {
  int cur = 0;
  for (int i = 0; i < m; i++) {
    int y = s[i] - 'a';
    if (!nx[cur][y]) nx[cur][y] = ++cnt, f[cnt] = cur;
    cur = nx[cur][y];
  }
  b[cur] = 1;
  return cur;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    m = strlen(s);
    Ans += m;
    int x = Ins(i);
    Q.push(pair<int, int>(m, x));
  }
  while (!Q.empty()) {
    pair<int, int> t = Q.top();
    Q.pop();
    int lst = t.first;
    t.second = f[t.second];
    --t.first;
    while (t.second && b[t.second]) t.second = f[t.second], --t.first;
    if (t.second)
      b[t.second] = 1, Q.push(pair<int, int>(t.first, t.second)),
      Ans -= lst - t.first;
  }
  cout << Ans << endl;
  return 0;
}
