stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.271900347941798x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.5238615034951133x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.209617868899563x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.210002094708638x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.310274409698234x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.270057778792495x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.278419088468107x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.27623833064241x):
#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;

}
// Slower C++ solution:
#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;}

// Faster C++ solution for the same problem (measured speedup: 5.276614803812735x):
#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;

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

using namespace std;

int main(){

	string s;

	cin>>s;

	int ans=0;

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

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

	}

	cout<<ans;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3104485812125235x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char a[100005];int l,i,ans;

int main(){

	scanf("%s",a);

	l=strlen(a);

	for(i=1;i<l;i++)

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

			ans++;

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

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.221472846064631x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

	long long i,s=0;

	string n;

	cin>>n;

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

	{

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

	}

	cout<<s<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.318299677096333x):
#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;

}
// Slower C++ solution:
#include<iostream>

#include<string>

using namespace std;

string a;

long long b;

int main()

{

	cin>>a;

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

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

	cout<<b;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.266728612614494x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string a;

int s;

int main()

{

cin>>a;

for(int i=1;i<a.size();i++)if(a[i-1]!=a[i])s++;

cout<<s<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.279871016643461x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int i,s;

string a;

int main(){

	cin>>a;

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

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

			s++;

		}

	}

	cout<<s<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.278419088468107x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char a[100005];

int main()

{

	cin>>a;

	int len=strlen(a),ans;

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

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

			ans++;

	cout<<ans<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.279546066146236x):
#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;

}
// Slower C++ solution:
// luogu-judger-enable-o2

#include<bits/stdc++.h>



using namespace std;

//

//struct node

//{

//    char str[1005];

//}zifu[1005];



int main()

{



    string s;

    cin>>s;

    int ans=0;

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

    {

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

        {

            ans++;

        }

    }

    cout<<ans-1<<endl;



}


// Faster C++ solution for the same problem (measured speedup: 5.320497714480363x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char c[100005];

int ans;

int main(){

	scanf("%s",c);

	int l=strlen(c);

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

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

			++ans;

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

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.220217413614956x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string a;

long long b;

int main()

{

    cin>>a;

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

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

			b++;

    cout<<b;

}

// Faster C++ solution for the same problem (measured speedup: 5.266728612614494x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int ans;

char s[100001];

int main()

{

	cin>>s;

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

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

      cout<<ans-1<<endl;

    return 0;

 }

// Faster C++ solution for the same problem (measured speedup: 5.278655989345565x):
#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;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<cstdio>

using namespace std;

int s;

string st;

int main()

{

	cin>>st;

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

	{

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

	}

	cout<<s;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2696071744496376x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char x[100005],y;

int g,z;

int main()

{

	while(x[z]=getchar(),x[z]!='\n')

	{

		

		if(z==0)y=x[z];

		if(x[z]!=y)g++,y=x[z];

		

		z++;

	}

	

	cout<<g;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.221564156249436x):
#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;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define ll long long

char a[100100];

int main()

{

    int i,j,k,m,n,cnt=0;

    cin>>a;

    n=strlen(a);

    char b=a[0];

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

    {

        if(a[i]!=b)

        {

            cnt++;

            b=a[i];

        }

    }

    cout<<cnt<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.286521825618354x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

using namespace std;

int main(){

	ios::sync_with_stdio(false);

	string sInput;

	int i,ans=0;

	cin >> sInput;

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

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

			++ans;

	}

	cout << ans << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.401748340863474x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define IL inline

#define RI register int

std::string a;

int ans;

int main()

{

    std::cin>>a;

    for(RI i=1;i<a.length();i++)

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

    std::cout<<ans<<std::endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.286716274922033x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>

#include <iomanip>

#include <algorithm>

#include <string>

#include <cstring>

#include <climits>

#include <vector>

#include <stdlib.h>

#include <memory.h>

using namespace std;

#define M 50000

typedef unsigned long long big;



int main()

{

	string s;

	cin>>s;

	big ans=0;

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

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

	ans++;

	cout<<ans<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.283331188685996x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include<cstdio>

#include<cstdlib>

#include<iostream>

#include<algorithm>

#include<cmath>

#include<map>

#include<queue>

#include<stack>

#include<list>

#include<set>

#include<cstring>

#include<string>

using namespace std;

char a[100005];

int main(){

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	scanf("%s",a);

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

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

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

	}

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

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.226328001371385x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

using namespace std;

long long a;

string b;

int main()

{

	cin>>b;

	for(int i=0;i<b.length()-1;i++)

	{

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

	}

	cout<<a<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.28346249949536x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include<iostream>

using namespace std;

string a;

int ans;

int main()

{	

	cin>>a;

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

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

	ans++;

	cout<<ans<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.286716274922033x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    string a;

    int sum=0;

    cin>>a;

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

    {

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

            sum++;

    }

    cout <<sum<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2857777406201905x):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

    char n[100000];

    int jsq=0,len;

    scanf("%s",&n);

    len=strlen(n);

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

    {

        if(n[i]!=n[i-1])jsq++;

    }

    printf("%d",jsq);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define ll long long

char a[100100];

int main()

{

    int i,j,k,m,n,cnt=0;

    cin>>a;

    n=strlen(a);

    char b=a[0];

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

    {

        if(a[i]!=b)

        {

            cnt++;

            b=a[i];

        }

    }

    cout<<cnt<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.275423432587595x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

using namespace std;

int main(){

	ios::sync_with_stdio(false);

	string sInput;

	int i,ans=0;

	cin >> sInput;

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

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

			++ans;

	}

	cout << ans << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.390408044139524x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define IL inline

#define RI register int

std::string a;

int ans;

int main()

{

    std::cin>>a;

    for(RI i=1;i<a.length();i++)

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

    std::cout<<ans<<std::endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.275617473669221x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>

#include <iomanip>

#include <algorithm>

#include <string>

#include <cstring>

#include <climits>

#include <vector>

#include <stdlib.h>

#include <memory.h>

using namespace std;

#define M 50000

typedef unsigned long long big;



int main()

{

	string s;

	cin>>s;

	big ans=0;

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

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

	ans++;

	cout<<ans<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.2722394939994155x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstdlib>

#include<iostream>

#include<algorithm>

#include<cmath>

#include<map>

#include<queue>

#include<stack>

#include<list>

#include<set>

#include<cstring>

#include<string>

using namespace std;

char a[100005];

int main(){

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	scanf("%s",a);

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

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

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

	}

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

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.215355977764902x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

using namespace std;

long long a;

string b;

int main()

{

	cin>>b;

	for(int i=0;i<b.length()-1;i++)

	{

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

	}

	cout<<a<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.272370529138117x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

string a;

int ans;

int main()

{	

	cin>>a;

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

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

	ans++;

	cout<<ans<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.275617473669221x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    string a;

    int sum=0;

    cin>>a;

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

    {

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

            sum++;

    }

    cout <<sum<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.274680909703054x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

string str;

int main(){

	int ans = 0; 

	cin>>str;

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

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

			ans += 1;

		}

	} 

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

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.253232509855227x):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

char s[110000];

int main(){

	scanf("%s",s);

	int l=strlen(s),ans=0;

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

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

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

	return 0;

}