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