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