#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll z = 0;
int main() {
  string S;
  cin >> S;
  int k = S.size();
  int ans = k;
  char pre = S.at(0);
  bool n_skip = true;
  for (int i = 1; i < k; i++) {
    if (n_skip) {
      if (S.at(i) == pre) {
        ans--;
        n_skip = false;
      }
    } else {
      n_skip = true;
    }
  }
  cout << ans << endl;
}
