#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int len;
  while (cin >> s) {
    int num = 1;
    len = 0;
    for (int i = 0; i < s.size() - 1; i++) {
      if (s[i] == s[i + 1])
        num++;
      else {
        if (num % 2 == 0) {
          len++;
          num = 1;
        }
      }
      if (i == s.size() - 2)
        if (num % 2 == 0) len++;
    }
    cout << len << endl;
  }
}
