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