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


int main() {
  
  string S;
  cin >> S;

  int ans = 0;
  string bef,now;

  for(int i = 0;i < S.size();i++) {
    now.push_back(S.at(i));
    if(now != bef) {
      bef = now;
      now.clear();
      ans++;
    }
  }

  cout << ans << endl;
  
}
