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

int main(){
  string S;
  cin >> S;
  
  int ans;
  int N = S.length();
  int count = 0;
  
  repeat(i,N-1){
    if(S[i]==S[i+1]){
      count++; 
      i+=2;
    }
  }
 
  ans = N - count;
    
  cout << ans << endl;
}