#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  char c = s[0];
  for (int i = 1; i < s.length(); i++) {
    if (c == s[i]) {
      if (s.length() - i > 1) {
        i += 2;
        ans += 2;
      } else {
        ans++;
      }
    } else {
      if (i == s.length() - 1) {
        ans++;
      }
      ans++;
    }
    c = s[i];
  }
  cout << ans << endl;
  return 0;
}
