#include <bits/stdc++.h>
using namespace std;
void mymain() {
  string s;
  cin >> s;
  long long ans = 1, n = s.size();
  for (long long i = 1; i < n; i++) {
    if (s[i] != s[i - 1])
      ans++;
    else {
      ans++;
      i++;
    }
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t;
  t = 1;
  for (long long tt = 0; tt < t; tt++) {
    mymain();
  }
  return 0;
}
