#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  long long c = 0, f = 0;
  getline(cin, s);
  for (int i = (0); i < (s.length() - 1); i++) {
    c++;
    if (s[i] != s[i + 1])
      continue;
    else if (s[i] == s[i + 1] && f == 0) {
      f = 1;
      i = i + 1;
    } else {
      f = 0;
      i = i - 1;
    }
  }
  cout << c - 1 << "\n";
  return 0;
}
