#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  int l = 0;
  int bj = 0;
  int ans = 0;
  while (l < s.size()) {
    if (bj == 0) {
      l++;
      ans++;
      bj = 1;
    } else {
      if (s[l] == s[l - 1]) {
        l = l + 2;
        if (l >= s.size()) break;
        ans++;
        bj = 0;
      } else {
        l++;
        ans++;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
