#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int d = 0;
  int cnt = 0;
  int max = (s.length() % 2 == 0 ? s.length() - 1 : s.length());
  for (int i = 0; i < max; i++) {
    if (d == 0) {
      d = 1;
      cnt++;
    } else {
      if (d == 2) {
        d = 1;
        cnt++;
      } else {
        if (s[i - 1] != s[i]) {
          d = 1;
          cnt++;
        } else {
          d = 2;
          i++;
          cnt++;
        }
      }
    }
  }
  cout << cnt << endl;
}
