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

int main()
{
	string S;
	cin >> S;
	const int N = S.size();
	int res = N;
	for (int i = 1; i < N; i++) {
		if (S[i - 1] == S[i]) {
			--res;
			i += 2;
		}
	}
	cout << res << endl;
	return 0;
}
