#include <bits/stdc++.h>

using namespace std;

int main() {

	string s;
	cin >> s;

	int counter = 1;
	int i = 0;
	while (1) {
		if (s[i] != s[i + 1]) { i++; }
		else {
			i++; i++; i++;
			if (i > s.size() ) { break; }
			counter++;
		}

		if (i > s.size() - 1) { break; }
		counter++;
	}

	cout << counter << endl;
}