#include<bits/stdc++.h>
#define ri register int
using namespace std;
const int N=2e5+5;
char s[N];
int n;
string t[N];
int top=0;
int main(){
	#ifdef ldxcaicai
	freopen("lx.in","r",stdin);
	#endif
	scanf("%s",s+1),n=strlen(s+1);
	int ans=n;
	for(ri i=1;i<=n;++i)if(s[i]==s[i-1])s[i+1]='0',--ans;
	cout<<ans;
	return 0;
}