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

int main()
{	
	string s;
	cin >> s;
	int k = 1;
	string temp = s.substr(0,1);
	string t = "";
	for(int i = 1;i < s.size();i++){
		t += s[i];
		if(t == temp) continue;
		temp = t;
		t = "";
		k++;
	}
	cout << k << endl;
	return 0;
}