#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int k = 1;
  string t = "";
  t = s[0];
  for (int i = 0; i < n - 1; i++) {
    string d = "";
    d = s[i];
    if (d == t) {
      t = s[i] + s[i + 1];
      i++;
    } else {
      t = s[i];
    }
    k++;
  }
  cout << k;
}
