#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int pos = 0, ans = 0;
  while (pos < s.size()) {
    char c = s[pos];
    int cnt = 0;
    while (pos < s.size() && c == s[pos]) {
      pos++;
      cnt++;
    }
    if (cnt % 2 == 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
