#include<iostream>
#include<cstring>
#include<sstream>

using namespace std;


int main() {
	string s;
	int n,nr=0;
	cin >> s;
	string x = "",y="";
	for (int i = 0;i <= s.size() - 1;i++) {
		x = x + s[i];
		if (x!=y) {
			nr++;
			y = x;
			x = "";
		}
	}

	cout << nr;

	return 0;
}