#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 1;
  bool ok = true;
  for (int i = 0; i < s.size() - 1; i++) {
    if (ok) {
      ans++;
      ok = false;
    } else if (s.at(i) != s.at(i + 1)) {
      ans++;
      ok = false;
    } else {
      ok = true;
    }
  }
  cout << ans << endl;
  return 0;
}
