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