#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int a=1;
string s,ss[220000];
signed main()
{
	cin>>s;
	ss[0]=s[0];
	for(int i=1;i<s.size();i++){
		ss[a]+=s[i];
		if(ss[a-1]!=ss[a]){
			a+=1;
		}
	}
	cout<<a;
}