#include <bits/stdc++.h>
int main() {
  char str[103];
  scanf("%s", &str);
  int i, k = 0, count = 0, l = strlen(str);
  for (i = 0; i < l;) {
    while (str[i] == str[i + 1] && i < l) {
      k++;
      i++;
    }
    if (k % 2 == 1) count++;
    if (k == 0) i++;
    k = 0;
  }
  printf("%d", count);
  return 0;
}
