#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int ans = 1;
  char c = s[0];
  bool skip = false;
  for (int i = 1; i < s.size(); i++) {
    if (not skip and s[i] == c) {
      skip = true;
    } else {
      skip = false;
      ans++;
    }
    c = s[i];
  }
  cout << ans << endl;
  return 0;
}
