#include <bits/stdc++.h>
using namespace std;
string str,now,last;
int ans = 1;
int main() {
	cin >> str;
	last = str[0];
	for (size_t i = 1;i < str.size();i++) {
		now += str[i];
		if (now == last) continue;
		last = now;
		now = "";
		ans++;
	}
	printf("%d",ans);
	return 0;
}