#include<iostream>
#include<cmath>
#include <algorithm>
using namespace std;
int main()
{
	string s;
	cin >> s;
	int ans=0;
	int n=s.size();
	int i=1;
	while(i<s.size()){
		if(s[i]==s[i-1])
		{
			ans++;
			i+=3;
		}
		else i++;
	}
	cout << n-ans << endl;
}