#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l = 0;
  string str;
  j = 1;
  cin >> str;
  char ch = str[0];
  for (i = 1; i < str.length(); i++) {
    if (ch == str[i])
      j++;
    else {
      if (j % 2 == 0) l++;
      j = 1;
      ch = str[i];
    }
  }
  if (j % 2 == 0) l++;
  cout << l;
  return 0;
}
