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

int s = 1, z;
string a;
int main()
{
	int i;
	cin >> a;
	for (i = 1; i < a.size(); i++) {
		if (a[i] != a[i - 1] || z == 1) {s++; z = 0;}
		else {
			if (i + 1 < a.size()) s++;
			i++; z = 1;
		}
	}
	cout << s;
    return 0;
}
