#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
#define ll long long 
#define ull unsigned ll 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define REP1(i,n) for (int i=1;i<=(n);i++)
#define RREP(i,n) for (int i=(n)-1; i>=0; i--)
#define pii pair<int,int>
#define SZ(x) x.size()
#define ALL(x) x.begin(), x.end()
#define ull unsigned ll 
#define pb push_back
#define SQ(x) (x)*(x)
#define endl '\n'
using namespace std;

int main (){
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	string s; cin>>s;
	int siz=s.size();
	int ans=0;
	string prev=s.substr(0,1);
	REP(i,siz){
		if (s.substr(i,1)!=prev) {
			ans++;
			prev=s.substr(i,1);
			continue;
		}
		prev=s.substr(i,2);
		if (i+1==n) break;
		i++;
		ans++;
	}
	cout<<ans<<endl;
}
