#include <bits/stdc++.h>
using namespace std;
const int MOD = 95542721;
const int INF = 2e9;
const long long INF64 = 4e18;
const long double EPS = 1e-16;
const long long MD = 1551513443;
const long long T = 2543;
const int N = 100010;
const int M = 100;
const int DEBUG = 0;
const int MAGIC = 320;
int nn = 1, h[N];
bool mark[N];
struct node {
  node *c[26];
  int ind;
  node() {
    for (int i = 0; i < int(26); i++) c[i] = nullptr;
    ind = nn++;
    h[ind] = 0;
  }
  node(int hh) {
    for (int i = 0; i < int(26); i++) c[i] = nullptr;
    ind = nn++;
    h[ind] = hh;
  }
} head;
int n, sum;
string s;
vector<int> g[N];
void push_bor(string &s) {
  node *v = &head;
  for (int i = 0; i < int(s.size()); i++) {
    int first = int(s[i]) - int('a');
    if (v->c[first] == nullptr) {
      v->c[first] = new node(h[v->ind] + 1);
      g[v->ind].push_back(v->c[first]->ind);
    }
    v = v->c[first];
  }
  mark[v->ind] = true;
}
pair<int, int> t[N * 4 + 100];
void update(int v, int tl, int tr, int ind, pair<int, int> val) {
  if (tl == tr)
    t[v] = val;
  else {
    int sdfjahlfasfh = (tl + tr) / 2;
    if (ind <= sdfjahlfasfh)
      update(v * 2, tl, sdfjahlfasfh, ind, val);
    else
      update(v * 2 + 1, sdfjahlfasfh + 1, tr, ind, val);
    t[v] = max(t[v * 2], t[v * 2 + 1]);
  }
}
pair<int, int> get(int v, int tl, int tr, int l, int r) {
  if (l <= tl && r >= tr) return t[v];
  if (r < tl || l > tr) return make_pair(0, 0);
  int sdfjahlfasfh = (tl + tr) / 2;
  return max(get(v * 2, tl, sdfjahlfasfh, l, r),
             get(v * 2 + 1, sdfjahlfasfh + 1, tr, l, r));
}
int tin[N], tout[N], timer = 1;
void dfs(int v) {
  tin[v] = timer++;
  for (auto u : g[v]) dfs(u);
  tout[v] = timer;
  if (!mark[v]) {
    pair<int, int> q = get(1, 1, N, tin[v], tout[v]);
    if (q.first != 0) {
      sum -= q.first - h[v];
      update(1, 1, N, tin[q.second], make_pair(0, 0));
      mark[v] = 1;
    }
  }
  if (mark[v]) update(1, 1, N, tin[v], make_pair(h[v], v));
}
int main() {
  cin >> n;
  for (int i = 0; i < int(n); i++) {
    cin >> s;
    sum += s.size();
    push_bor(s);
  }
  mark[1] = true;
  dfs(1);
  cout << sum;
  return 0;
}
