#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  int sum = 0, k = 0;
  for (int i = 1; i < a.length(); i++) {
    if (a[i] == a[i - 1]) {
      k++;
    }
    if (a[i] != a[i - 1]) {
      k++;
      if (k % 2 == 0 && i != 1) sum++;
      k = 0;
    }
    if (i == a.length() - 1 && a[i] == a[i - 1]) {
      k++;
      if (k % 2 == 0) sum++;
    }
  }
  cout << sum;
}
