#include <iostream>
#include <cstdio>
using namespace std;

string s, t, bf="";
int ans;
int main() {
	cin >> s;
	for(int i=0; i<s.size(); ) {
		t = s[i];
		if(t != bf) {
			ans++;
			i++;
		} else if(s[i+1]) {
			t += s[i+1];
			ans++;
			i += 2;
		} else break;
		bf = t;
	}
	cout << ans;
	return 0;
}
