#include <bits/stdc++.h>
int main() {
  int i, s = 0, g = 0;
  char c, q = '*';
  for (i = 0;; i++) {
    c = '*';
    scanf("%c", &c);
    if (c == '*' || c == '\n') {
      if (g % 2 == 0 && g != 0) s++;
      g = 0;
      break;
    }
    if (c != q) {
      if (g % 2 == 0 && g != 0) s++;
      g = 0;
    }
    g++;
    q = c;
  }
  printf("%d", s);
}
