#include <bits/stdc++.h>
using namespace std;
int n = 1, len, cnt = 1, ans = 0;
string s;
int main() {
  cin >> s;
  len = s.size();
  while (n < len) {
    if (s[n] == s[n - 1])
      ++cnt;
    else {
      if (!(cnt & 1)) ++ans;
      cnt = 1;
    }
    ++n;
  }
  if (!(cnt & 1)) ans++;
  cout << ans;
  return 0;
}
