#include <iostream>
#include <string>
using namespace std;

int main() {
  string S; cin >> S;
  int a = 0, b = 0;
  for(int i = 1; i <= S.size(); ++i) {
    if(a == 0 && S[i] == S[i-1]) a++, i++;
    else a = 0;
    b++;
  }
  cout << b << endl;
  return 0;
}
