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

int main()
{
	string s;
	cin >> s;
	string last = "";
	string cur = "";
	int cnt = 0;
	for (int i = 0; i < s.length(); ++i)
	{
		cur += s[i];
		if (cur != last)
		{
			last = cur;
			cur = "";
			cnt++;
		}
	}
	cout << cnt << endl;
}