#include <bits/stdc++.h>
using namespace std;
int sol;
string s;
int main() {
  cin >> s;
  int L = 1;
  for (int i = 1; i < s.size(); ++i) {
    if (s[i] == s[i - 1]) L++;
    if (s[i] != s[i - 1]) {
      if (L % 2 == 0) sol++;
      L = 1;
    }
  }
  if (L % 2 == 0) sol++;
  cout << sol;
}
