#include<iostream>
#include<string>

int main() {
	std::string s;
	std::cin >> s;
	int ans = 0;
	for (int i = 0; i < s.size(); i++) {
		ans++;
		if (s[i] == s[i + 1]) {
			i += 2;
			if (i < s.size()) {
				ans++;
			}
		}
	}
	std::cout << ans;
}
