#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int res = 0, cnt = 0;
  bool judge = 1;
  for (int i = 0; i < (int)(s.size() - 1); i++) {
    if (s[i] == s[i + 1]) {
      if (judge) {
        res++;
        i++;
        judge = 0;
      } else
        res++, judge = 1;
    } else
      res++;
  }
  cout << res << endl;
}
