Var
  N, i, j: integer;
  O, S: string;
  Sz: longint;

BEGIN
  Assign(input, 'INPUT.TXT'); Reset(input);
  Readln(N);
  Readln(O);
  Sz := Length(O);
  for i := 2 to N do begin
    Readln(S);
    j := 0;
    while (j < Length(O)) and (j < Length(S)) and 
      (O[j+1] = S[j+1]) do Inc(j);
    Inc(Sz);
    Inc(Sz, Length(S) - j);
    O := S;
  end;
  Assign(output, 'OUTPUT.TXT'); Rewrite(output);
  Writeln(Sz);
END.