#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int acc = 0;
  string latest_string = "";
  bool last_flag;
  for (int i = 0; i < s.size(); i++) {
    if (to_string(s[i]) != latest_string) {
      acc++;
      latest_string = to_string(s[i]);
      last_flag = true;
    } else {
      latest_string += to_string(s[i]);
      last_flag = false;
    }
  }
  if (last_flag) {
    cout << acc << endl;
  } else {
    cout << acc + 1 << endl;
  }
  return 0;
}
