#include <bits/stdc++.h>
using namespace std;
string s;
vector<long> dp;
int main() {
  cin >> s;
  dp = vector<long>(s.length() + 1, 0);
  for (long i = 1; i <= s.length(); i++) {
    if (i == 1) dp[i] = 1;
    if (i == 2) {
      if (s[i - 1] != s[i]) {
        dp[i] = dp[i - 1] + 1;
      } else {
        dp[i] = dp[i - 1];
      }
    }
    if (i >= 3) {
      if (dp[i - 1] == dp[i - 2]) {
        dp[i] = dp[i - 1] + 1;
      } else {
        if (s[i] != s[i - 1]) {
          dp[i] = dp[i - 1] + 1;
        } else {
          dp[i] = dp[i - 1];
        }
      }
    }
  }
  cout << dp[s.length()] << endl;
  return 0;
}
