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

int main(){
	string s;
	cin >> s;
	int ans = 0;
	bool d = false;
	for(int i = 0; i < s.size(); ++i){
		if(!d && s[i] == s[i+1]){
			++i;
			d = true;
		}else{
			d = false;
		}
		ans++;
	}
	printf("%d\n", ans);
}