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