program wto;
var
f:array[1..100010] of string;
i,j,n,m:longint;
k:int64;
procedure qsort(l,r:longint);
var i,j:longint;
mid,t:string;
begin
i:=l;
j:=r;
mid:=f[(l+r) div 2];
while i<=j do
begin
while f[i]<mid do inc(i);
while f[j]>mid do dec(j);
if i<=j then
begin
t:=f[i];
f[i]:=f[j];
f[j]:=t;
inc(i);
dec(j);
end;
end;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
assign(input,'trie.in');
reset(input);
assign(output,'trie.out');
rewrite(output);
i:=0;
while not eof() do
begin
inc(i);
readln(f[i]);
end;
n:=i;
qsort(1,n);
k:=length(f[1]);
for i:=2 to n do
begin
j:=1;
while (f[i-1][j]=f[i][j])and(j<=length(f[i-1])) do inc(j);
inc(k,length(f[i])-j+1);
end;
writeln(k+1);
close(input);
close(output);
end.