#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.size() == 1) {
    cout << 1;
    return 0;
  }
  int ans = 0;
  string prev = "" + s[0];
  string curr;
  for (int i = 1; i < s.size(); ++i) {
    curr += s[i];
    if (curr != prev) {
      prev = curr;
      ++ans;
      curr = "";
    }
  }
  cout << ans;
}
