#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  string s;
  cin >> s;
  int N = s.length();
  vector<int> dp(200002);
  dp[0] = 1;
  if (N == 1) {
    cout << 1 << endl;
  }
  if (dp[0] == dp[1])
    dp[1] = 1;
  else
    dp[1] = 2;
  for (int i = (2); i <= (N - 1); ++i) {
    if (s[i - 1] != s[i])
      dp[i] = max(dp[i - 2] + 1, dp[i - 1] + 1);
    else
      dp[i] = dp[i - 2] + 1;
  }
  cout << dp[N - 1] << "\n";
}
