#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, br, c = 0;
  string s;
  cin >> s;
  k = 1;
  n = s.length();
  for (i = 0; i < n; i = i + k) {
    br = 1;
    j = i;
    while (s[j] == s[j + 1] && j < n) {
      br++;
      j++;
    }
    if (br % 2 == 0) c++;
    k = br;
  }
  cout << c << endl;
}
