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