#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int ans = 0;
  string s;
  cin >> s;
  string ss = s;
  string re = "", cur;
  for (int i = s.size() - 1; i > 0 && s.size() > 0; i--) {
    string c = {s[i]};
    if (re != c) {
      cur = s.substr(i);
      s.erase(i);
    } else {
      cur = s.substr(i - 1);
      s.erase(i - 1);
    }
    if (re == c) {
      continue;
    }
    re = cur;
    ans++;
  }
  cout << ans << endl;
}
