#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
	int cnt=0;
	string s;
	string s1="";
	string temp="";
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		s1+=s[i];
		if(s1==temp)
			continue;
		else{
			temp=s1;
			s1="";
			cnt++;
		}
	}
	cout<<cnt<<endl;
	
	
	
	return 0;
}