#include <bits/stdc++.h>
using namespace std;
char s[10001];
int main() {
  gets(s);
  int len = strlen(s);
  int js = 0;
  int lenth = 1;
  for (int i = 0; i < len;) {
    for (int j = i + 1; j <= len; j++) {
      if (s[i] == s[j])
        lenth++;
      else {
        if (lenth % 2 == 0) js++;
        lenth = 1;
        i = j;
      }
    }
  }
  cout << js;
  return 0;
}
