#include<bits/stdc++.h>

using namespace std;
int main(){
	string s;
	cin>>s;
	string s1="";
	string s2="";
	int sum=0;
	for(int i=0;i<s.length();i++){
		s1=s[i]+s1;
		if(s1!=s2){
			sum++;
			s2=s1;
			s1="";
		}
	}

	cout<<sum;

} 
