#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int out = 1;
  bool one = true;
  for (int i = 1; i < S.size(); i++) {
    if (one) {
      out += 1;
      if ((S.at(i - 1) == S.at(i))) {
        one = false;
      }
    } else {
      one = true;
    }
  }
  cout << out << endl;
}
