#include <iostream>
#include <string>
using namespace std;

string s;
int k = 0;
bool f = 1;

int main()
{
	cin >> s;

	for (int i = 0; i < s.size(); i++) {
		if (f) {
			if (s[i] == s[i + 1]) {
				i++;
				f = 0;
			}
		}
		else
			f = 1;

		k++;
	}

	cout << k << endl;

	return 0;
}