#include <bits/stdc++.h>
using namespace std;
void main_() {
  string S;
  cin >> S;
  set<string> divides;
  char prev = '\0';
  int count = 0;
  bool cont = false;
  bool prev_cont = false;
  for (auto it = begin(S); it != end(S); ++it) {
    if (prev != *it || cont) {
      count++;
      prev_cont = cont;
      cont = false;
    } else {
      if (it == end(S) - 1 && prev_cont) {
        count++;
      }
      prev_cont = cont;
      cont = true;
    }
    prev = *it;
  }
  cout << count << endl;
}
int main() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios_base::sync_with_stdio(false);
  main_();
  return 0;
}
