include<stdio.h>

int main(void){
	char S[200000], a='';
	int i, count;
	scanf("%s", S);
	for(i=0; S[i] == "\0"; i++){
		if(a != S[i]){
    		a = S[i];
    		count++;
    	}
    	else a += S[i];
	}
	printf("%d\n", count);
	return 0;
}