#include <iostream>
#include <string>

using namespace std;
string s;
int main(){
	cin >> s;
	int i,n = s.size(),cnt = 0;
	string t,u;
	for(i=0;i<n;i++){
		if(t.size()==0){
			cnt++; t.push_back(s[i]);
		}else{
			u.push_back(s[i]);
			if(t!=u){
				cnt++;
				t = u; u.clear();
			}
		}
	}
	cout << cnt << endl;
}
	