#include<bits/stdc++.h>
using namespace std;
int ans;
int main()
{
	string s;
	cin >> s;
	string t;
	string cur;
	for (int i = 0;i < s.size();i++)
	{
		cur += s[i];
		if (cur == t)
		{
		}
		else
		{
			ans ++ ;
			t = cur;
			cur = "";
		}
	}
	cout << ans << endl;
	return 0;
}
