#include <bits/stdc++.h>
#define rep(i,n) REP(i,0,n)
#define REP(i,l,r) for(int i=l;i<r;++i)
#define int long long
#ifdef DEBUG
#define dout cout
#else
std::stringstream dout;
#endif
using namespace std;
typedef pair<int,int> P;
//other libs

signed main(int argc, char * argv[]) {
	string s;
	bool b=false,bback=false;
	cin>>s;
	int ans=1;
	rep(i, s.size() - 1) {
		if (s[i] == s[i + 1] && bback == false) {
			bback = b;
			b=true;
		}
		else {
			bback = b;
			b=false;
			ans++;
		}
	}
	cout<<ans<<endl;
}