#include<bits/stdc++.h>
using namespace std;

int main(){
	string s;
	cin >> s;
	int len = s.size();
	int num=0;
	string s1 = "";
	string s2 = "";
	for(int i=0;i<len;i++){
		s1+=s[i];
		if(s1==s2){
			continue;
		}
		else{
			s2=s1;
			s1="";
			num++;
		}
	}
	cout << num << endl;
	return 0;
}