#include <bits/stdc++.h>
using namespace std;
int main(void){
  int n,i=1,t=1,ans=1;
  string s;
  cin >> s;
  n=s.size();
  while (i<n){
    if (t==2){
      t=1;
      i++;
    }else if (s[i]==s[i-1]){
      t=2;
      i+=2;
    }else i++;
    ans++;
  }
  if (i==n+1) ans--;
  cout << ans << endl;
  return 0;
}