#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  bool flag = true;
  char now = S[0];
  int cnt = 1;
  for (int i = 1; i < S.length(); i++) {
    if (flag == true) {
      if (now == S[i]) {
        flag = false;
      } else {
        now = S[i];
        cnt++;
      }
    } else {
      now = S[i];
      flag = true;
      cnt++;
    }
  }
  if (flag == false) cnt++;
  cout << cnt << endl;
  return 0;
}
