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