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