Program exc1;
  Var a:string;
      b:string;
      max:longint;
      i,j,k,n,min:integer;
      pref, len:longint;
begin
 Assign(input,'input.txt');
 Reset(input);
 Readln(n);
 readln(a);
 len:=length(a);
 min:=length(a);
 for k:=1 to n-1 do
  begin
      readln(b);
      i:=1;
      if min>length(b) then min:=length(b);
      while (a[i]=b[i])and(i<=min) do
      begin
           inc(i);
      end;
      pref:=i-1;
      len:=len + length(b)-pref + 1;
      a:=b;
      min:=length(a);
 end;


Assign(output,'output.txt');
Rewrite(output);
     Write(len);
Close(output);
end.