#include <bits/stdc++.h>
using namespace std;
class ADividingAString {
 public:
  void solve(std::istream& in, std::ostream& out) {
    string s;
    in >> s;
    string t = "";
    int ans = 0;
    for (int i = 0; i < s.size(); i++) {
      string tt = "" + s[i];
      while (tt == t && i < s.size()) {
        i++;
        tt += s[i];
      }
      t = tt;
      ans++;
    }
    out << ans << endl;
  }
};
int main() {
  ADividingAString solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
