#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int ans{};
  string S;
  cin >> S;
  char b{0};
  for (char c : S) {
    if (c == b) {
      b = 0;
    } else {
      ++ans;
      b = c;
    }
  }
  if (!b) ++ans;
  cout << ans << endl;
}
