#include <bits/stdc++.h>
using namespace std;
template <typename T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <typename T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
const long long INF = 1e+18;
const double EPS = 1e-9;
const long long MOD = 1000000007;
const long long dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
signed main() {
  long long ans = 0;
  string s;
  cin >> s;
  char prev = '!';
  for (long long i = 0; i < s.length(); i++) {
    if (prev == s[i]) {
      prev = '!';
    } else {
      ans++;
      prev = s[i];
    }
  }
  if (prev == '!') ans++;
  cout << ans << endl;
}
