#include <cstdio>
#include <string>
#include <iostream>
using namespace std;

#define R register

int N, K;
string s, las, res;

int main() {
	cin >> s;
	N = s.length();
	for(R int i = 0; i < N; ++i) {
		res += s[i];
		if(res != las) ++K, las = res, res.clear();
	}
	return !printf("%d\n", K);
}
