#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int len=s.length();
	string s1;string s2="";
	s1=s[0];int t=1;int sum=1;
	for(int i=1;i<len;i++)
	{
		s2=s2+s[i];
		if(s1!=s2)
		{
			s1=s2;
			s2="";
			sum++;
		}
	}
cout<<sum;
} 