#include<bits/stdc++.h>
using namespace std;

int main(){
  string s;
  string c, p = "";
  int ans = 0;
  
  cin >> s;
  for(int i  = 0; i < s.size(); i++){
    c += s[i];
    if(c == p){
      continue;
    }else{
      p = c;
      c = "";
      ans++;
    }
  }
  cout << ans << endl;
  
}