#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

int main(){
  string S;
  cin >> S;
  int N;
  N = S.size();
  int cnt = 0;
  int i = 0;
  while(i<=N-1){
    if( S[i+1] == S[i] ){
      cnt++;
      i += 2;
    }
    i++;
  }

  cout << N - cnt << endl;

  return 0;
}
