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