program h; const n=1000; var i,k,b :integer;a:array [1..n]of integer; f1, f2: text; begin assign (f1,'count.in'); assign (f2, 'count.out'); reset (f1); read(f1,b); k:=0; for i:=1 to n do begin a[i]:= b mod 10; b:= b div 10; end; for i:=1 to n do if a[i]<>a[i+1] then k:=k+1; rewrite (f2); write (f2,k); close (f1); close (f2); end.