#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  string last = "";
  int ans = 0;
  for (int i = 0; i < s.size(); ++i) {
    string nw = "" + s[i];
    while (i < s.size() - 1 && nw == last) {
      nw += s[++i];
    }
    if (nw != last) ans++;
    last = nw;
  }
  cout << ans;
  return 0;
}
