"use strict";

// const input = "aabbaa";
const input = require("fs").readFileSync("/dev/stdin", "utf8");
const words = input.split("");

const main = (words) => {
    let answer = 0;
    let prev = '';
    let word = '';
    for (let i = 0; i < words.length; i++) {
        if (i - 1 === words.length && words[i+1] === words[i]) {
            answer++;
            break;
        }

        // 1文字取り出す
        word += words[i];
        if (word === prev) {
            continue;
        } else {
            answer++;
            prev = word;
            word = '';
        }
    }

    return answer;
};

console.log(main(words));