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