#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = 1;
  bool b = 0;
  for (int i = 1; i < s.size(); i++) {
    if (b) {
      b = 0;
      continue;
    } else if (s.at(i - 1) != s.at(i))
      a++;
    else {
      a++;
      b = 1;
    }
  }
  cout << a << endl;
}
