#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long c = 0;
  long l = s.length() - 1;
  for (long i = 0; i < l - 1; i++) {
    if (s[i] == s[i + 1]) c++;
  }
  cout << l - c + 1;
  return 0;
}
