#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  while (s.size() > 1) {
    if (s.at(0) != s.at(1)) {
      ans++;
      s = s.substr(1, s.size() - 1);
    } else {
      ans++;
      s = s.substr(2, s.size() - 2);
    }
  }
  cout << ans + s.size() << endl;
}
