#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  int count = 1;
  cin >> a;
  vector<char> c(a.size());
  for (int i = 0; i < a.size(); i++) {
    c.at(i) = a.at(i);
  }
  for (int i = 0; i < a.size(); i++) {
    if (c.at(i) == c.at(i + 1)) {
      i = i + 3;
      count++;
    }
    count++;
  }
  cout << count << endl;
}
