#include <bits/stdc++.h>
using namespace std;
int n = 1, s, i = 1;
char c[100];
int main() {
  cin >> c[0];
  while (cin >> c[i] && c[i] != '\0') {
    if (c[i] != c[i - 1]) {
      if (n % 2 == 0) s++;
      n = 1;
      i++;
    } else
      n++;
  }
  if (n % 2 == 0) s++;
  printf("%d", s);
  return 0;
}
