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

int main()
{
	string S;
	cin >> S;

	int n = S.size();
	string now;
	string last;
	int ans = 0;
	for( int i = 0; i < n; i++ ) {
		now += S[i];
		if( now != last ) {
			ans++;
			last = now;
			now = "";
		}
	}

	cout << ans <<  endl;
}
