#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long LINF = (long long)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
void print(const vector<int> &v) {
  for (auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  vector<int> dp(n + 1, 0);
  dp[1] = 1;
  for (int i = 0; i < (n); ++i) {
    if (i + 2 > n) break;
    if (s[i + 1] == s[i + 2]) {
      dp[i + 2] = dp[i] + 1;
    } else {
      dp[i + 2] = max(dp[i + 1], dp[i]) + 1;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
