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

int main(){
	ll n,m;
	string s;
	cin>>s;
	ll len = s.length();
	ll sum = 0;
	string tmp = "";
	string now = "";
	for(int i = 0;i < len;i++){
		now += s[i];
		if(now != tmp){
			sum++;
			tmp = now;
			now = "";
		}
	}
	cout<<sum<<endl;
	return 0;
}