#include <bits/stdc++.h>
using namespace std;
int main() {
  char S[100000];
  memset(S, NULL, sizeof(S));
  cin >> S;
  int S_len = 0;
  ;
  for (S_len = 0; S_len < 100000; S_len++) {
    if (S[S_len] == NULL) {
      break;
    }
  }
  int now_index = 0;
  int count = 0;
  for (int i = 1; i < S_len; i++) {
    if (strcmp(&S[now_index], &S[i]) != 0) {
      for (int j = now_index + 1; j <= i; j++) {
        S[j + 1] = S[now_index];
      }
      now_index = i;
      count++;
    }
  }
  cout << count;
  return 0;
}
