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

string s , last , now;
int k;

int main()
{
	cin >> s;
	for(int i = 0 ; i < s.size() ; i ++)
	{
		now += s[i];
		if(now != last) last = now , now.clear() , k ++;
	}
	cout << k << endl;
} 