#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  char old = s[0];
  long long count = 1;
  bool flag = false;
  for (int i = 1; i < s.size(); i++) {
    if (old == s[i]) {
      if (flag) {
        count++;
        flag = false;
      } else {
        flag = true;
      }
    } else {
      count++;
      flag = false;
    }
    old = s[i];
  }
  if (flag) {
    count++;
  }
  cout << count;
}
