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