"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0];
    
    let before  = "";
    let current = "";
    let list   = [];
    
    for(let i=0; i<S.length; i++) {
        current += S[i];
        
        if(current === before) {
            continue;
        }
        
        before = current;
        list.push(current);
        
        current = "";
    }
    
    console.log(list.length);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));