#include <bits/stdc++.h>
using namespace std;
int cnt = 1, answer;
string s;
int main() {
  cin >> s;
  s += 'Z';
  for (int i = 0; i < s.length(); i++) {
    if (s[i] != s[i - 1]) {
      answer += !(cnt & 1);
      cnt = 1;
    } else
      cnt++;
  }
  cout << answer;
  return 0;
}
