#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	int n = s.size();
	int r = 0;
	string cur;
	cur += s[0];
	r = 1;
	string t = "";
	int k = 1;
	while(r < n){
		t += s[r];
		if(t != cur){
			cur = t;
			k++;
			t = "";
		}
		r++;
	}
	cout<<k<<endl;
	return 0;
}
