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