#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int count = 1;
  char now = S.at(0);
  for (int i = 1; i < S.size() - 1; i++) {
    if (i == S.size() - 2) {
      if (S.at(S.size() - 2) == S.at(S.size() - 1)) {
        count++;
      } else {
        count += 2;
      }
      break;
    }
    count++;
    if (now == S.at(i)) {
      i++;
      now = NULL;
    } else {
      now = S.at(i);
    }
  }
  cout << count << endl;
}
