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

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