#include<bits/stdc++.h>
using namespace std;
int n,ans;
char s[234234];

int main()
{
	int i,pd;
  scanf("%s",s+1),n=strlen(s+1);
  ans=1,pd=1; 
  for(i=2;i<=n;i++)
    {
	  if(s[i]==s[i-1] && pd) 
	    {
		  if(i<n) ans++;
		  i++;
		  pd=0;
		}
		else ans++,pd=1;
	}
  cout<<ans<<endl;
}