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