#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = 1, b{};
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == s[i - 1]) a++;
    if (s[i] != s[i - 1] || i == s.size() - 1) {
      if (a % 2 == 0) {
        b++;
        a = 1;
      }
    }
  }
  cout << b << '\n';
}
