#include "bits/stdc++.h"
using namespace std;
int main(){
  string s;
  cin >> s;
  vector<string> v;
  int n=s.size();
  for(int i=0;i<n;i++){ 
    string t=s[i];
    if(s[i]!=v.back()){
      v.push_back(s[i])
    }else{
      if(i=n-1) continue;
      t=t+s[i+1];
      i++;
    }
  }
  cout<<v.size()<<endl;
  return 0;
}