fork download
  1. var
  2. a:array [0..100005] of ansistring;
  3. n, cnt, i:longint;
  4. begin
  5. readln(n);
  6. cnt:=0;
  7. for i:=0 to n-1 do
  8. begin
  9. readln(a[i]);
  10. end;
  11. for i:=0 to n-1 do
  12. begin
  13. if (a[i]<>a[i+1]) then cnt:=cnt+1;
  14. end;
  15. write(cnt);
  16. end.
Success #stdin #stdout 0s 4280KB
stdin
1
01
stdout
1