const nmax=200010;
var save:array[1..100010] of char;
    c:char;
    i,count:int64;
begin
read(save[1]);
i:=1;
count:=1;
repeat 
read(c);
if save[i] <> c then
 begin inc(count);
       i:=1    end
else inc(i);
 save[i]:=c;

until ord(c) in [26,32,10];


write(count)
end.