#include <bits/stdc++.h>

using namespace std;

string s;

int main() {
	cin >> s;
	int ans = 1;
	string be;
	be += s[0];
	string now;
	int i = 1;
	while (i < s.length()) {
		now += s[i];
		if (now != be) {
			be = now;
			now = "";
			ans++;
		}
		i++;
	}
	cout << ans << endl;
	return 0;
}