program cjen;
var
a:array[1..250000] of string;
i,j,n,t:longint;
procedure q(l,r:longint);
var
mid,p:string;
i,j:longint;
begin
i:=l; j:=r;
mid:=a[(l+r) div 2];
repeat
while a[i]<mid do inc(i);
while a[j]>mid do dec(j);
if i<=j then begin
p:=a[i]; a[i]:=a[j]; a[j]:=p;
inc(i); dec(j);
end;
until i>j;
if i<r then q(i,r);
if l<j then q(l,j);
end;
begin
assign(input,'trie.in'); reset(input);
assign(output,'trie.out'); rewrite(output);
while not eof do begin
n:=n+1;
readln(a[n]);
end;
q(1,n);
t:=length(a[1]);
for i:=2 to n do begin
j:=1;
while (a[i][j]=a[i-1][j]) and (j<=length(a[i-1])) do inc(j);
t:=t+length(a[i])-j+1;
end;
inc(t);
writeln(t);
close(input); close(output);
end.