#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    string S;
    cin >> S;
    int K = S.size();
    int i = 0;
    while(i < S.size()){
        if(S[i] == S[i+1]){
            i += 2;
            K--;
        }
        ++i;
    }
    cout << K;
    return 0;
}