#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
const int maxn=200005;
int ans;
string str;
int main()
{
	cin>>str;
	ans=str.length();
	for(int i=0;i<(int)str.length()-1;i++)
		if(str[i]==str[i+1])
		{
			ans--;
			i+=2;
		}
	cout<<ans<<endl;
	return 0;
}