#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int S_len;
  cin >> S;
  S_len = S.size();
  int i = 0, cnt = 1;
  while (i < S_len - 1) {
    if (S.at(i) == S.at(i + 1)) {
      if (i == S_len - 2) {
        cnt -= 2;
      }
      i += 2;
      cnt += 2;
    } else {
      cnt++;
    }
    i++;
  }
  cout << cnt << endl;
}
