#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define double long double
typedef long long ll;
typedef pair<int,int>P;

const int MOD=1000000007;

ll gcd(ll x, ll y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
ll lcm(ll x, ll y) {
    return x * y / gcd(x, y);
}

void solve(std::string S){
    ll cnt=0;
    string lhs, rhs;
    lhs = S[0];
    for (ll i = 1; i < S.length(); i++) {
        rhs = S[i];
        if ( lhs == rhs ) {
            rhs = rhs + S[i+1];
            i++;
        }
        lhs = rhs;
        cnt++;
    }
    if ( S[S.length()-1] == S[S.length()-2] ) {
        cnt--
    }
    cout << cnt << endl;
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}
