#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "{";
  for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
int main() {
  string s;
  char rem;
  cin >> s;
  int ans = 0;
  bool skip = false;
  for (int i = 0; i < s.size(); i++) {
    if (skip) {
      rem = s[i];
      ans++;
      skip = false;
      continue;
    }
    if (i == 0) {
      rem = s[0];
      ans++;
    } else {
      if (rem == s[i]) {
        skip = true;
      } else {
        rem = s[i];
        ans++;
      }
    }
  }
  cout << ans << "\n";
}
