#include<cstdio>
#include<cstring>
#define RI register int
#define CI const int&
using namespace std;
const int N=200005;
char s[N]; int n,ans,pos;
int main()
{
	scanf("%s",s+1); n=strlen(s+1); ans=n; pos=1;
	for (RI i=2;i<=n;++i)
	if (s[i]==s[pos]) --ans,pos=i+2,i+=2; else pos=i;
	return printf("%d",ans),0;
}