"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];
    let list = [];
    
    for(let i=1; i<S.length; i++) {
        if(last === S[i]) {
            if(S[i] !== S[~~i + 1]) {
                last = S[i] + S[~~i + 1];
                list.push(S[i] + S[~~i + 1]);
                i++;
            } else {
                last = last + S[i];
                list.push(last);
            }
        } else {
            last = S[i];
            list.push(last)
        }
    }
    
    console.log(list.length);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
