#include <bits/stdc++.h>
using namespace std;
string S;
int N, ans;
int main() {
  int i, j;
  cin >> S;
  N = S.size();
  char x = S[0];
  ans++;
  for (i = 1; i < S.size(); i++) {
    if (x == S[i]) {
      i++, x = '0';
      if (i + 1 < N) ans++;
    } else
      ans++, x = S[i];
  }
  printf("%d", ans);
}
