#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i;
  stack<char> st;
  int cn = 0;
  int opt = 0;
  int r = 1;
  st.push(s[0]);
  for (i = 1; i < s.size() + 1; i++) {
    char x = st.top();
    if (s[i] == x)
      opt = 1;
    else
      opt = 0;
    char y = s[i];
    st.push(y);
    if (opt == 0) {
      if (r % 2 == 0) cn++;
      r = 1;
    } else
      r++;
  }
  cout << cn;
  return (0);
}
