#include <bits/stdc++.h>
using namespace std;
string s;
void solve() {
  cin >> s;
  long long n = int(s.size());
  long long slen = 1;
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    if (s[i - 1] != s[i]) {
      if (slen == 2) slen = 1;
      ans++;
    } else {
      if (slen == 1) {
        ans++;
        i++;
        slen = 2;
      }
    }
  }
  cout << ans + 1 << endl;
}
int main(int argc, char *argv[]) {
  solve();
  return 0;
}
