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