#include <bits/stdc++.h>
using namespace std;
int main() {
  string n;
  cin >> n;
  int i = 0, j = 1, k = 0;
  while (i < n.length()) {
    while ((j < n.length()) && n[j] == n[j - 1]) {
      j++;
    }
    if ((j - i) % 2 == 0) {
      k++;
    }
    i = j;
    j++;
  }
  cout << k;
  return 0;
}
