#include <bits/stdc++.h>
int fx[] = {-1, +0, +1, +0, +1, +1, -1, -1, +0};
int fy[] = {+0, -1, +0, +1, +1, -1, +1, -1, +0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
using namespace std;
bool comp(int x, int y) { return x > y; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  int cnt = 1, cum = 0;
  cin >> s;
  for (int i = (0); i < (s.length() - 1); i++) {
    if (s[i] != s[i + 1]) {
      if (cnt % 2 == 0) cum++;
      cnt = 1;
    } else
      cnt++;
  }
  if (cnt % 2 == 0) cum++;
  cout << cum;
  return 0;
}
