#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long LINF = 1LL << 60;
const int INF = 1 << 30;
int main() {
  string S;
  cin >> S;
  int n = (int)(S.length());
  vector<int> dp(n);
  int i = 0;
  dp[0] = 0;
  int tmp = 1;
  while (i < n - 1) {
    if (tmp == 1) {
      if (S[i] != S[i + 1]) {
        dp[i + 1] = dp[i] + 1;
        i++;
        tmp = 1;
      } else {
        dp[i + 1] = dp[i];
        dp[i + 2] = dp[i] + 1;
        i += 2;
        tmp = 2;
      }
    } else {
      dp[i + 1] = dp[i] + 1;
      i++;
      tmp = 1;
    }
  }
  if (dp[n - 1] == 0) {
    cout << dp[n - 1] << endl;
  } else {
    cout << dp[n - 1] + 1 << endl;
  }
  return 0;
}
