/*input
aaaccacabaababc
*/
#include <bits/stdc++.h> 

using namespace std; 

int main() {
    ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	
	string s;
	cin >> s;

	int c = 0;

	for(int i = 0; i < s.length()-1; i++) {
		if(s[i] == s[i+1]) {
			c++;
			i+= 2;
		}
	}


	cout << s.length() - c;

	return 0; 
} 
