#include <bits/stdc++.h>
using namespace std;
int dp[20000 + 1];
int main() {
  string S;
  cin >> S;
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 1; i < S.size(); i++) {
    if (S[i + 1] == S[i]) {
      dp[i + 1] = dp[i];
      if (S[i + 2] == S[i]) {
        dp[i + 2] = dp[i + 1] + 1;
      }
    } else {
      dp[i + 1] = dp[i] + 1;
    }
  }
  cout << dp[S.size()] << endl;
}
