#include <bits/stdc++.h>
using namespace std;
string s;
long long l;
vector<long long> dp;
long long max(long long a, long long b) { return a > b ? a : b; }
long long go(long long i) {
  if (dp[i] < 0 && i <= l) {
    if (i == l)
      dp[i] == 1;
    else if (s[i] != s[i + 1])
      dp[i] = 1 + go(i + 1);
    else
      dp[i] = 1 + max(go(i + 1), go(i + 2));
  }
  return dp[i];
}
int main() {
  cin >> s;
  l = s.length() - 1;
  dp.resize(l + 5, -1);
  long long count = go(0);
  cout << count << endl;
  return 0;
}
