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