#include <bits/stdc++.h>
using namespace std;
string str;
int main() {
  cin >> str;
  int ans = 0, res = 1;
  str += "!";
  for (int i = 1; i < str.size(); i++) {
    if (str[i] == str[i - 1]) {
      res++;
    } else {
      if (res % 2 == 0) {
        ans++;
      }
      res = 1;
    }
  }
  cout << ans << endl;
  return 0;
}
