const nmax=200010;
var S:array[1..nmax] of char;
    save,c:char;
    count,i,len:int64;
    flag:boolean;
begin
read(c);
i:=1;
repeat 
s[i]:=c;
inc(i);
read(c);
until ord(c) in [26,32,10];
len:=i-1;

flag:=false;
save:=s[1];
count:=1;
i:=1;
while i<=len do
begin
c:=s[i];
if flag then flag:=false 
else 
   if save=c then
   if i=len then break
   else
   begin inc(i);
         flag:=true end;
 inc(count);     
 save:=c;
 inc(i)
end;

write(count-1)
end.