#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  long long ans = 0;
  long long N = S.size();
  long long i = 0;
  while (i < N) {
    if (S[i - 1] == S[i] && i == N - 1) ans--;
    if (i != 0 && S[i - 1] == S[i]) {
      i++;
    }
    if (S[i - 1] == S[i] && i == N - 1) ans--;
    ans++;
    i++;
  }
  cout << ans << endl;
  return 0;
}
