program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s,s1:string;
  f:text;
  i,j,n,res:integer;
procedure plus;
var
  s2:string;
begin
  j:=0;
  while s[j+1]=s1[j+1]do inc(j);
  if j>length(s)then j:=length(s);
  res:=res+length(s1)-j+1;
end;
begin
  assignfile(f,'input.txt');
  reset(f);
  readln(f,n);
  readln(f,s);
  res:=length(s);
  for i:=1 to n-1 do
    begin
      readln(f,s1);
      plus;
      s:=s1;
    end;
  closefile(f);
  assign(f,'output.txt');
  rewrite(f);
  write(f,res);
  closefile(f);
  { TODO -oUser -cConsole Main : Insert code here }
end.
