#include <bits/stdc++.h>

using namespace std;

int main()
{
	string s;
	cin >> s;
	int ans = 0;
	string prev, curr;
	prev = "";
	curr = "";
	for (int i = 0; i < s.length(); i++) {
		curr = curr + s[i];
		if (prev != curr) {
			ans++;
			prev = curr;
			curr = "";
		}
	}
	cout << ans;
}