#include <bits/stdc++.h>
using namespace std;
struct greateri {
  template <class T>
  bool operator()(T const &a, T const &b) const {
    return a > b;
  }
};
int main() {
  string cal;
  cin >> cal;
  long long ans = 0;
  for (long long i = 0; i < cal.size(); ++i) {
    if (i < cal.size()) {
      if (cal[i] == cal[i + 1]) {
        i += 2;
        if ((i + 1) <= (cal.size() - 1))
          ans += 2;
        else
          ans++;
      } else
        ans++;
    }
  }
  cout << ans;
  return 0;
}
