#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	int cnt=0;
	string s1="",s2="";
	for(int i=0;i<s.size();i++){
		s1+=s[i];
		if(s1!=s2){
			cnt++;
			s2=s1;
			s1="";
		}
	}
	printf("%d",cnt);
	return 0;
}