#include <bits/stdc++.h>
int main() {
  std::string S;
  std::cin >> S;
  long len = S.length();
  long i = 1;
  long counter = 1;
  std::string temp1, temp2;
  temp1 = S[0];
  while (i < len) {
    temp2 = S[i];
    if (temp2 == temp1) {
      if (i != len - 1) {
        counter += 2;
        temp1 = S[i + 2];
        i += 3;
      } else {
        break;
      }
    } else {
      counter++;
      temp1 = S[i];
      i += 1;
    }
  }
  std::cout << counter << std::endl;
  return 0;
}
