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