#include <bits/stdc++.h>
using namespace std;
char a[10001];
int main() {
  int sum = 0, cnt = 0;
  cin >> a;
  int len = strlen(a);
  for (int i = 0; i < len; ++i) {
    if (a[i] == a[i + 1])
      sum++;
    else {
      if (sum % 2 != 0) cnt++;
      sum = 0;
    }
  }
  cout << cnt;
  return 0;
}
