#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int sum = 0;
  for (int i = 0; i < s.length(); i++) {
    char ch = s[i];
    int j;
    for (j = i; j < s.length(); j++) {
      if (ch != s[j]) {
        break;
      }
    }
    if ((j - i) % 2 == 0) {
      i = j - 1;
      sum++;
    }
    i = j - 1;
  }
  cout << sum;
  return 0;
}
