#include<stdio.h>
#include<cmath>
#include<algorithm>
#include<functional>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
long long mod = 1000000007;
using namespace std;
int main(void)
{
	char s[100010];
	scanf("%s", s);
	int count = 0;
	int i = 0;
	while (true) {
		if (s[i] == s[i + 1]) {
			i++;
		}
		count++;
		if (s[i + 1] == '\0'||s[i]=='\0') {
			break;
		}
	}
	printf("%d", count);
	return 0;