#include <bits/stdc++.h>
using namespace std;
char st[200010];
int main() {
	scanf("%s", st);
	int n = strlen(st);
	string s = "", pre = "";
	int ans = 0;
	for(int i = 0; i < n; ++ i) {
		s += st[i];
		if(s != pre) {
			pre = s;
			s = "";
			++ ans;
		}
	}
	printf("%d\n", ans);
}