#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
    string S;
    cin >> S;
    int ans = 0, n = S.size();
    rep(i, n) {
        ans++;
        if (S[i] == S[i + 1]) {
            i += 2;
            if (i < n) ans++;
        }
    }
    cout << ans << endl;
}
