stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <cstdio>

#include <cmath>



#include <algorithm>

#include <iostream>

#include <vector>

#include <list>

#include <tuple>

#include <string>



using namespace std;



#define MAX(A, B)	((A) > (B) ? (A) : (B))

#define MIN(A, B)	((A) < (B) ? (A) : (B))





int main(int argc, char const *argv[]) {

	string s;

	cin >> s;



	char c = s[0];

	int r = 0;



	for (int i = 1; i < s.length(); ++i) {

		if (c != s[i]) {

			c = s[i];

			r += 1;

		}

	}



	cout << r << endl;



	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

char str[100050];

int main()

{

	while(~scanf("%s",str))

	{

		int ans = 0;

		char ch;

		int n = strlen(str);

		ch = str[0];

		for(int i = 0;i < n;i++)

		{

			if(str[i] != ch)

			{

				ans++;

				ch = str[i];

			}

		} 

		printf("%d\n",ans);

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <algorithm>

#include <iostream>

#include <string>

#include <unordered_set>

#include <vector>

using std::cin;

using std::cout;

using std::endl;

using std::ios;

using std::string;



int main() {

  ios::sync_with_stdio(false);

  cin.tie(0);

  string str;

  int count = 0;

  cin >> str;

  char t = str[0];

  for (int i = 1; i < str.size(); i++) {

    if (str[i] != t) {

      count++;

      t = str[i];

    }

  }

  cout << count << endl;

  return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

char str[100050];

int main()

{

	while(~scanf("%s",str))

	{

		int ans = 0;

		char ch;

		int n = strlen(str);

		ch = str[0];

		for(int i = 0;i < n;i++)

		{

			if(str[i] != ch)

			{

				ans++;

				ch = str[i];

			}

		} 

		printf("%d\n",ans);

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cmath>

#include<algorithm>

#include<cstdio>

#include<stack>

#include<queue>

#include<map>



using namespace std;



int main(){

	string s;

	cin>>s;

	int ans=0;

	char c=s[0];

	for(int i=1;i<s.length();i++){

		if(c!=s[i]){

			ans++;

			c=s[i];

		} 

	}

	cout<<ans<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

char str[100050];

int main()

{

	while(~scanf("%s",str))

	{

		int ans = 0;

		char ch;

		int n = strlen(str);

		ch = str[0];

		for(int i = 0;i < n;i++)

		{

			if(str[i] != ch)

			{

				ans++;

				ch = str[i];

			}

		} 

		printf("%d\n",ans);

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;



int main ()

{

	char S[100000+521];

	memset(S,0,sizeof(S));

	cin >> S;

	int ans=0;

	for(int i = 0;S[i+1]!=0;i++)

	{

		if(S[i]!=S[i+1])

			ans++;

	}

	cout << ans;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

char s[100005];

int main()

{

	scanf("%s",s);

	int l=strlen(s);

	int sum=0;

	for(int i=0;i<l;i++)

		if(s[i]!=s[i+1])

			sum++;

	printf("%d\n",sum-1);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

const int N = 100010;



char s[N];



int main()

{

int aa;

    scanf("%s", s);

    int cnt = 0, len = strlen(s);

    for (int i = 1; i < len; i++)

        if (s[i] != s[i - 1])

            cnt ++;

    printf("%d\n", cnt);

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=a;i<=b;i++)

#define per(i,a,b) for(int i=a;i>=b;i--)

#define gpf(...) fprintf(stderr,__VA_ARGS__)

using namespace std;

typedef long long ll;



char st[110000];

int len;



int main(){

	scanf("%s", st + 1);

	len = strlen(st + 1);

	int ans = 0;

	rep(i, 2, len) if (st[i] != st[i - 1]) ans++;

	printf("%d\n", ans);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define rep(i,a,n) for(int _tmp=n,i=a;i<=_tmp;++i)

#define dep(i,a,n) for(int _tmp=n,i=a;i>=_tmp;--i)

#define re(i,a,n) for(int _tmp=n,i=a;i<_tmp;++i)

#define fec(i,a) for(__typeof a.begin() i=a.begin();i!=a.end();++i)

#define For(i,v,u) for(int i=H[u],v=to[i];i;i=nxt[i],v=to[i])

#define si(x) (int)x.size()

#define pb push_back

#define mp make_pair

#define mt make_tuple

#define X first

#define Y second

#define inf 1000000000

using namespace std;

template<class T> inline void read(T&x){char c;bool fu=0;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x*=-1;}

template<class T> inline void read(T&x,T&y){read(x);read(y);}

template<class T> inline void read(T&x,T&y,T&z) {read(x,y);read(z);}

template<class T> inline void MAX(T&x,T y){if(x<y)x=y;}

template<class T> inline void MIN(T&x,T y){if(x>y)x=y;}

typedef long long ll;

typedef pair<int,int> pii;

typedef tuple<int,int,int> tiii;

const int N=111111;

//head

int cnt;

char s[N];

int main() {

	scanf("%s",s+1);int len=strlen(s+1);

	rep(i,1,len)if(s[i]!=s[i-1])++cnt;

	printf("%d\n",cnt-1);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;

char s[N];

int main() {

	int n;

	scanf("%s", s);

	int ans = 0;

	n = strlen(s);

	for (int i = 1; i < n; ++ i) {

		if (s[i] != s[i - 1]) ans ++;

	}

	printf("%d\n", ans);

}




// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstring>

using namespace std;

char s[101010];

int main()

{

	cin>>s+1;

	int n=strlen(s+1);

	int ans=0;

	for(int i=2;i<=n;i++)

		if(s[i]!=s[i-1])

			ans++;

	cout<<ans<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <fstream>

#include <vector>

#include <string>

#include <algorithm>

#include <cmath>

#include <cstdlib>

using namespace std;

#define mod 1000000007



int main()

{

	//freopen("test", "r", stdin);

	string s; cin >> s;

	int ret = 0;

	for (int i = 1; i < s.size(); ++i) {

		if (s[i] != s[i - 1]) {

			++ret;

		}

	}

	cout << ret << '\n';

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



char s[100010];

int n;



int main()

{

	scanf("%s", s + 1);

	n = strlen(s + 1);

	int ans = 0;

	for (int i = 1; i <= n; i++)

	{

		if (s[i] != s[i - 1]) ans++;

	}

	cout << ans - 1 << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



char s[100005];

int len;





int main()

{

	scanf("%s", s + 1);

	len = strlen(s + 1);

	int ans1 = 0;

	for(int i = len; i; i--)

	{

		if(i == len || s[i] != s[i + 1])

		{

			ans1++;

		}

	}

	ans1--;

	int ans2 = 0;

	for(int i = 1; i <= len; i++)

	{

		if(i == 1 || s[i] != s[i - 1])

		{

			ans2++;

		}

	}

	ans2--;

	printf("%d\n", min(ans1, ans2));

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



const int N = 100000 + 10;



int n;

char ss[N];



int main() {

	scanf( "%s", ss + 1 );

	n = (int)strlen( ss + 1 );

	int tot = 0;

	for( int i = 1, j; i <= n; i = j + 1 ) {

		for( j = i; j + 1 <= n && ss[j+1] == ss[i]; j++ );

		tot++;

	}

	printf( "%d\n", tot - 1 );

}




// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

char st[112345];

int main(){

	scanf("%s",st);

	int n = strlen(st);

	int ans = 0;

	for (int i = 1; i < n; i++){

		if (st[i] != st[i - 1]) ans ++;

	}

	printf("%d\n",ans);

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<map>

using namespace std;

int main(){

	char s[105000];

	scanf("%s", s + 1);

	int n = strlen(s + 1);

	char cur = s[1];int ans = 0;

	for(int i = 2; i <= n; i++)

		if(cur != s[i]) cur = s[i], ans++;

	cout<<ans;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstring>

#include <cmath>

#include <algorithm>

#include <cstdio>

#include <queue>

#include <ctype.h>

#include <set>

#include <map>

#include <list>

#include <stack>



using namespace std;

char s[100500];

int main()

{

    scanf("%s",s);

	int ans=0;

	int zhen=0;

	int len=strlen(s);

	while(zhen<len)

	{

		ans++;

		int tmp=s[zhen];

		while(s[zhen]==tmp)

		{

			zhen++;

		}

	}

	printf("%d\n",ans-1);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <algorithm>

using namespace std;



typedef long long LL;



char str[1111111];



int main() {

	/*ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);*/

	

	scanf("%s", str + 1);

	int l = strlen(str + 1);

	int sum = 0;

	for (int i = 2; i <= l; ++i) {

		if (str[i] != str[i - 1]) {

			++sum;

		}

	}

	cout << sum << endl;

/*	if (flag) {

		puts("0");

	} else {

		if (str[1] == 'W' || str[l] == 'W') {

			puts("1");

		} else {

			puts("2");

		}

	}*/

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

using namespace std;

int main()

{

    string s;

    cin >> s;

    char ch = s[0];

    int num = 0;

    for(int i = 1; i < s.length(); ++i)

    {

        if(s[i] != ch)

        {

            ++num;

            ch = s[i];

        }

    }

    cout << num << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#define rep(a,b,c) for(int a=b;a<c;a++)

#define rep_(a,b,c) for(int a=c-1;a>=b;a--)

using namespace std;



int main()

{

	cin.sync_with_stdio(false);

	cout.sync_with_stdio(false);

	string s;

	int ans=0;

	getline(cin,s);

	rep(i,1,s.length())

		if (s[i-1]!=s[i]) ans++;

	cout << ans << endl;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <algorithm>

#include <iostream>

#include <cstring>

#include <cstdio>



using namespace std;



const int N = 1e5 + 10;



char s[N];



int main() {



	scanf(" %s", s + 1);

	int n = strlen(s + 1);

	char l = 0;

	int m = 0;

	for (int i = 1; i <= n; ++i) {

		if (s[i] != l || i == 1) {

			l = s[i];

			++m;

		}

	}

	printf("%d\n", m - 1);



	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):


#include<bits/stdc++.h>

#define sz(x) ((int)(x).size())

#define rep(i,a,b) for (int i=(a); i<(b); i++)

#define per(i,a,b) for (int i=(b-1); i>=(a); i--)

#define debug(x) cout << #x << " => " << x << endl

using namespace std;



#define fi first

#define se second

#define mp make_pair

typedef pair<int,int> pii;



#define pb push_back

typedef vector<int> vi;



typedef long long ll;

typedef long double ld;



const int MAX_N = 7 + 100000;

///----------------------------------------------

char str[MAX_N];

int main() {



	///read

	scanf(" %s",str); int len=strlen(str);



	///work

	int ans=0;

	rep(i,1,len) {

		ans+=str[i]!=str[i-1];

	}



	///print

	printf("%d",ans);







}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

long long  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	for (i=1;i<=strlen(f)-1;i++){

		if (f[i]!=f[i-1]) ans++;

	}

	printf("%lld",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cmath>

#include <list>

#include <algorithm>

#include <queue>





//g++ -std=c++11 IPL.cpp -o IPL

using namespace std;





int main(int argc, char**argv){

  string chips;

  cin >> chips;

  int num =0;

  int length = chips.size();

  for(int i = 0; i+1 <length; i++){

    if(chips[i] != chips[i+1]){

      num++;

    }else{

      continue;

    }









  }



  cout << num;



  return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

			if(str[i]!=a[1])

			{

				a[1]=str[i];

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0);

    string s; cin >> s;

    int res = 0;

    for (int i = 1; i < (int)s.size(); i++) {

        res += (s[i] != s[i - 1]);

    }

    cout << res << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

			if(str[i]!=a[1])

			{

				a[1]=str[i];

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

using namespace std;



int main () {

	string s;

	cin >> s;

	int ug = 1;

	for (int i = 1; i < s.length(); i++) {

		if (s[i] != s[i-1]) {

			ug++;

		}

	}

	cout << ug-1 << "\n";

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

			if(str[i]!=a[1])

			{

				a[1]=str[i];

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

int main(){

	char a[100050]={0};

	while(~scanf("%s",a))

	{

		int k=strlen(a);

		int sum=0;

		for(int i=1;i<k;i++)

		{

			if(a[i-1]!=a[i])

			{

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

			if(str[i]!=a[1])

			{

				a[1]=str[i];

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;

char s[100005];

int main()

{

	while(~scanf("%s",s)){

		int len=strlen(s);

		char c=s[len-1];

		int num=0;

		for(int i=len-2;i>=0;i--){

			if(s[i]!=c){

				num++;

				c=s[i];

			}

			

		}

		printf("%d\n",num);

	}

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

			if(str[i]!=a[1])

			{

				a[1]=str[i];

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

#include<cmath>

#include<cstring>

#include<algorithm>

using namespace std;

char s[100010];

int main()

{

	int sum=0;

	scanf("%s",s);

	for(int i=0 ; i<strlen(s)-1; i++)

	{

		if(s[i]!=s[i+1])

		sum+=1;

	}

	printf("%d\n",sum);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

			if(str[i]!=a[1])

			{

				a[1]=str[i];

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <map>

#include <set>

#include <queue>

#include <stack>

#include <cmath>

#include <cstdio>

#include <string>

#include <cstring>

#include <iostream>

#include <algorithm>

using namespace std;



#define ls st<<1

#define rs st<<1|1

#define LL long long

#define CLR(a,b) memset(a,(b),sizeof(a))



const int MAXN = 1e5+11;

const int mod = 1e9+7;

const int INF = 0x3f3f3f3f;

const LL INFLL = (1LL<<60);



/*-------------------------------------------------------*/



int x[MAXN], y[MAXN], t[MAXN];

int main() {

    string s;

    cin >> s;

    int k = 0;

    for(int i = 1; i <s.size(); i++) {

        if(s[i]!=s[i-1]) k++;

    }

    cout << k << endl;

return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

			if(str[i]!=a[1])

			{

				a[1]=str[i];

				sum++;

			}

		}

		printf("%d\n",sum);

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

string st;

int main(void)

{

	cin>>st;

	int ans=0;

	for(int i=0;i<st.size()-1;i++)

	  if(st[i]!=st[i+1])ans++;

	cout<<ans;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

char c[100005];

int ans,len;

int main()

{

  scanf("%s",c);len=strlen(c);

  for(int i=1;i<len;i++)  if(c[i]!=c[i-1])  ans++;

  printf("%d\n",ans);

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

string a;

int i,sum;

int main(){

    cin>>a;

    for(i=1;i<a.size();i++)

        if(a[i]!=a[i-1]) sum++;

    cout<<sum<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

char c[100005];

int ans,len;

int main()

{

  scanf("%s",c);len=strlen(c);

  for(int i=1;i<len;i++)  if(c[i]!=c[i-1])  ans++;

  printf("%d\n",ans);

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{char a[100000];

 cin>>a;

 int s=0;

 for(int i=0;i<strlen(a)-1;i++)

    if(a[i]!=a[i+1])

      s++;

 cout<<s<<endl;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

char c[100005];

int ans,len;

int main()

{

  scanf("%s",c);len=strlen(c);

  for(int i=1;i<len;i++)  if(c[i]!=c[i-1])  ans++;

  printf("%d\n",ans);

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

using namespace std;

string s;

signed main(){return cin>>s,s.erase(unique(s.begin(),s.end()),s.end()),cout<<s.size()-1<<endl,0;}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

char c[100005];

int ans,len;

int main()

{

  scanf("%s",c);len=strlen(c);

  for(int i=1;i<len;i++)  if(c[i]!=c[i-1])  ans++;

  printf("%d\n",ans);

  return 0;

}

// Fastest known solution for this problem: