#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  int ans = 1;
  for (int i = 1; i < s.size(); ++i) {
    if (s.at(i - 1) == s.at(i)) {
      ++i;
    }
    ++ans;
  }
  cout << ans << endl;
  return 0;
}
