"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    let cnt = 1;
    let dupulicateFlg = false;
    let last = S[0];
    
    for(let i=1; i<S.length; i++) {
        if(last === S[i]) {
            last = S[i];
            dupulicateFlg = true;
        /*
        console.log("被り")
        console.log("i:" + i);
        console.log("cnt:" + cnt);
        console.log("last:" + last);
        console.log("-------------");
        */
            continue;
        } else {
            cnt++;
            if(dupulicateFlg) {
                last = last + S[i];
                dupulicateFlg = false;
            } else {
                last = S[i];
            }
        /*
        console.log("被らない")
        console.log("i:" + i);
        console.log("cnt:" + cnt);
        console.log("last:" + last);
        console.log("-------------");
        */
        }
    }
    
    console.log(cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));