#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  string s;
  cin >> s;
  ;
  string r = "";
  string g = "";
  long long int t = 0;
  for (long long int i = 0; i < s.length(); i++) {
    string g(1, s[i]);
    if (g != r) {
      r = g;
      t++;
    } else {
      r = r + s[i];
    }
  }
  cout << t << endl;
  return 0;
}
