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