#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;cin>>s;
  int cnt=0;
  for(int i=0;i<size(s)-1;i++){
    if(s[i]==s[i+1]) ++cnt;
  }
  cout<<size(s)-cnt<<endl;
  return 0;
}