var
i,j,n,t:longint;
a:array[0..250000]of string;
procedure qsort(l,r:longint);
var
i,j:longint;
mid,t:string;
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
t:=a[i];
a[i]:=a[j];
a[j]:=t;
inc(i);
dec(j);
end;
until i>j;
if i<r then qsort(i,r);
if l<j then qsort(l,j);
end;
begin
assign(input,'trie.in');reset(input);
assign(output,'trie.out');rewrite(output);
fillchar(a,sizeof(a),0);
while not eof do
begin
inc(n);
readln(a[n]);
end;
qsort(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;
writeln(t+1);
close(input);close(output);
end.