#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
#define rep(i,s,t) for(register int i=s;i<=t;++i)
#define _rep(i,s,t) for(register int i=s;i>=t;--i)
const int N=1e7+11;
string las,now;
char s[N];
int ans;
int main(){
	gets(s+1);
	for(int i=1;s[i];++i){
		now+=s[i];
		if(now!=las)
			las=now,++ans,now="";
	}
	printf("%d\n",ans);
	return 0;
}