#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 1;
  string tmp = "";
  tmp += s[0];
  for (int i = 1; i < s.size(); ++i) {
    if (tmp == to_string(s[i])) {
      if (i < s.size() - 1) tmp += s[i + 1];
      continue;
    }
    tmp = to_string(s[i]);
    ans++;
  }
  cout << ans << endl;
}
