#include<bits/stdc++.h>
using namespace std;
string s,s1,s2;
int ans = 1;
int main()
{
	cin >> s;
	int len = s.length();
	s1 +=s[0];
	for(int i = 0;i < len;i++){
		for(int j = i+1;j<len;j++){
			s2 += s[j];
			if(s1!=s2){
				s1 = s2;
				s2.clear();
				i = j;
				ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}