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