using System;

public class Program{
    public static void Main(){
        char[] S=Console.ReadLine().ToCharArray();
        int l=S.Length;
        bool state=true;
        int ans=1;
        for(int i=1;i<l;){
            if((state&&(S[i]!=S[i-1]))||!state){
                i++;
                ans++;
                state=true;
            }else{
                i+=2;
                ans++;
                state=false;
            }
        }
        if(S[l-1]==S[l-2]){
            ans--;
        }
        Console.WriteLine(ans);
    }
}
