#include <bits/stdc++.h>
using namespace std;
const int n = 1e5 + 5;

int N;

int main(){
	string s;
	cin >> s;
	N = s.size();
	int K = 1;
	int ll = 1, i = 1;
	for(i = 1; i < N; ++i){
		if(ll == 1 && s[i] == s[i-1]){
			ll = 2;
			i++;
		}else{
			ll = 1;
		}
		K++;
	}
	if(i == N+1)
		K--;
	cout << K << endl;
	return 0;
	
}
