#include <bits/stdc++.h>
using namespace std;
int main() {
  int ctr = 0;
  char c, last;
  cin >> last;
  int len = 1;
  while (cin >> c) {
    if (c != last) {
      if ((len & 1) == 0) {
        ctr++;
      }
      len = 0;
      last = c;
    }
    len++;
  }
  if ((len & 1) == 0) {
    ctr++;
  }
  cout << ctr << endl;
}
