using namespace std;
int main(){
      string S;
    string prev="";
    string buff="";
    cin >> S;
    long l = 0;
    long cnt = 0;

    for(long l = 0; l < S.size();l++){
        buff+=S[l];
        if(prev.compare(buff)==0){
            
        }else{
            prev=buff;
            cnt++;
            buff="";
        }
    }
    cout << cnt <<endl;
 }