#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  char last = 0;
  for (int i = s.size() - 1; i >= 0; --i) {
    if (s[i] == last)
      last = 0;
    else {
      ++ans;
      last = s[i];
    }
  }
  if (last == 0) ++ans;
  cout << ans << endl;
  return 0;
}
