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

string s;
int n, k = 1, ans;
char a = '0';
int main() {
	cin >> s;
	n = s.size();
	for (int i = 0; i < n; i++) {
		if (k == 1) {
			if (a != s[i]) {
				ans++;
				a = s[i];
			}
			else {
				k = 2;
			}
		}
		else {
			ans++;
			k = 1;
			a = '0';
		}
	}
	cout << ans << endl;
}