#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0, flg = 0;
  for (int i = 0; i < (int)(s.size() - 1); i++) {
    if (i == 0)
      ans++;
    else if (flg == 1) {
      ans++;
      flg = 0;
    } else if (s.at(i) != s.at(i + 1))
      ans++;
    else {
      i++;
      flg = 1;
      ans++;
    }
  }
  if (flg == 1) ans++;
  cout << ans << endl;
  return 0;
}
