#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s,s1,s2;
int ans=0;
int main(){
	cin>>s;
	for(int i=0;i<s.length();i++){
		if(s1+s[i]!=s2){
			ans++;
			s2=s1+s[i];
			s1="";
		}
		else s1+=s[i];
	}
	cout<<ans;
	cout<<"\n";
    return 0;
}