#include <bits/stdc++.h>
using namespace std;
static const int MAX = 2e5 + 6;
int main() {
  string s;
  cin >> s;
  set<string> unique;
  int n = s.length();
  int dp[n];
  for (int i = 0; i < n; i++) {
    dp[i] = 0;
  }
  dp[0] = 1;
  int dbl;
  for (int i = 1; i < n; i++) {
    int j = i;
    dbl = 1;
    while (true) {
      if (s[j] == s[j - 1]) {
        dbl++;
      } else {
        break;
      }
      j++;
    }
    if (dbl == 1 && s[i] != s[i - 1]) {
      dp[i] = dp[i - 1] + 1;
    } else if (dbl % 2 == 1) {
      dp[i] = dp[i - 1];
    } else if (dbl % 2 == 0 && s[i] != s[i + 1]) {
      dp[i] = dp[i - 1] + 1;
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
