#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int result = 0;
  for (int i = 0, prev = -1, current = 0; i < s.size(); i++) {
    if (prev == 1 && s[i] == s[i - 1]) {
      current++;
    } else {
      result++;
      prev = current + 1;
      current = 0;
    }
  }
  cout << result;
  return 0;
}
