#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[200000];
  cin >> s;
  int len = strlen(s), count = 0;
  for (int i = 0; i < len; i++) {
    if (i == 0) {
      count++;
      continue;
    } else {
      if (s[i] != s[i - 1])
        count++;
      else
        continue;
    }
  }
  count++;
  cout << count << endl;
  return 0;
}
