#include <bits/stdc++.h>

int main() {
    using namespace std;

    string s;
    cin >> s;

    unsigned long ans{s.size()}, N{s.size()};
    char pc{'.'};
    for(unsigned long i = 0; i < N; ++i)if(pc == s[i]){
        --ans;
        ++i;
        pc = '.';
    }else pc = s[i];

    cout << ans << endl;

    return 0;
}