#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.length(); i++) {
    char ch = s[i];
    int count = 1;
    while (s[i + 1] == s[i] && i < i < s.length()) {
      i++;
      count++;
    }
    if (count % 2 == 0) ans++;
  }
  cout << ans << endl;
}
