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