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

string S, p;
int ans;

int main() {
	cin >> S;
	string cur = "";
	for (int i = 0; i < S.length(); i++) {
		cur += S[i];
		if (p != cur) {
			p = cur;
			cur = "";
			ans++;
		}
	}
	printf("%d\n", ans);
}
