#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  char p;
  int cnt = 0;
  cin >> S;
  for (int i = 0; i < S.size(); i++) {
    if (p == S[i]) {
      p = 0;
    } else {
      cnt++;
    }
  }
  cout << cnt << endl;
}
