#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  cin >> s;
  int numberOfSubstrings = 0;
  for (unsigned int i = 0; i < s.length() - 1;) {
    if (s[i] == s[i + 1]) {
      if (i + 2 < s.length()) {
        i += 3;
        numberOfSubstrings += 2;
      } else {
        i += 2;
        numberOfSubstrings++;
      }
    } else {
      i++;
      numberOfSubstrings++;
    }
  }
  if (s.length() > 1) {
    if (s[s.length() - 1] != s[s.length() - 2]) numberOfSubstrings++;
  }
  cout << numberOfSubstrings;
  return 0;
}
