#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string str;
  cin >> str;
  char cur = str.at(0);
  int curLength = 1;
  int K = 1;
  int i = 1;
  while (i < str.size()) {
    if (curLength == 1) {
      if (cur == str.at(i)) {
        curLength = 2;
        i += 2;
        if (i < str.size() - 1) {
          K++;
        }
      } else {
        cur = str.at(i);
        K++;
        i++;
      }
    } else {
      cur = str.at(i);
      curLength = 1;
      K++;
      i++;
    }
  }
  cout << K << '\n';
}
