stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}

// 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;

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;

}

// 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()

{

	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;

}

// 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<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;

}

// 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 s;

int main()

{

cin>>a;

for(int i=1;i<a.size();i++)if(a[i-1]!=a[i])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<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;

}

// 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;

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;

}

// 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):
// 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;



}


// 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;

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;

}

// 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;

long long b;

int main()

{

    cin>>a;

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

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

			b++;

    cout<<b;

}

// 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 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;

 }

// 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<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;

}

// 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;

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;

}

// 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;

#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;

}




// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

using namespace std;

int main(){

    string input;

    long long ans=0;

    cin>>input;

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

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

    }

    cout<<ans<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

# include <cstdio>

# include <cstring>



using namespace std;

 

string a;

int len, ans;



int main()

{

	cin >> a;

	

	len = a.length();

	

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

	{

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

		{

			ans ++;

		}

	}

	

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

			

	return 0;

} 

// Optimized solution to the same problem (faster):
// 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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#pragma GCC optimize(3)

#pragma GCC optimize("inline")

#pragma once

#include<bits/stdc++.h>

#define q register

#define qsize 1<<15

typedef long long ll;

using namespace std;

string s;

ll ans;

inline void qwrite(ll v)

{

	if(v>9)   qwrite(v/10);

	   putchar(v%10+'0');

}

int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cin>>s;

	for(q ll i=0;i<s.length()-1;i++){

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

	}

	qwrite(ans);

	putchar('\n');

	return 0;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

using namespace std;

char a[100000001];

int s=0;

int main(){

	cin>>a;

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

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

			s++;

	cout<<s;

	return 0;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

#include<cmath>

#include<string.h>

#include<stdio.h>

#include<map>

#include<time.h>

#include<queue>

#include<algorithm>

#include<vector> 

#include<set>

using namespace std;

int main() {

	string s;

	int ans=0;

	cin>>s;

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

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

			ans++;

		}

	}

	cout<<ans<<endl;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

using namespace std;

string bw;

int ans;

int main(){

	cin>>bw;

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

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

    }

    cout<<ans<<endl;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

using namespace std;

int main()

{

	long long ans=0;

	string s1;

	cin>>s1;

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

	{

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

			ans++;

	}

	cout<<ans<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

using namespace std;

int main()

{

	int ans=0;

	string s;

	getline(cin,s);

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

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

	}

	cout<<ans<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

using namespace std;

string a;

int ans=0;

int main()

{

	cin>>a;

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

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

			ans++;

	cout<<ans<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
// 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;

}

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

using namespace std;

string a;

int ans, i;

int main()

{

	cin >> a;

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

	{

		if(a.substr(i, 1) != a.substr(i - 1, 1)) ans ++;

	}

	cout << ans << endl;

	return 0;

}

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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

		if(a[i]!=a[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;

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;

}

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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

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

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

	return 0;

}


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

#include<string>

#include<cstring>

using namespace std;

string a;

int main(){

    long long ans=0;

    cin>>a;

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

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

    }

    cout<<ans<<endl;

    return 0;

}

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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

		if(a[i]!=a[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;

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<<endl; 

    return 0;

}

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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

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

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

	return 0;

}


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

#include<cstring>

using namespace std;

char s[100001];

int i,l,ans;

int main()

{

	cin>>s;

	l=strlen(s);

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

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

	cout<<ans<<endl;

	return 0;

}

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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

		if(a[i]!=a[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;

char x[110000];

int main()

{

	cin>>x;

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

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

	{

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

	}

	cout<<ans<<endl;

	return 0;

}

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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

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

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

	return 0;

}


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

#include<cstdio>

#include<cstring>

#include<algorithm>

#include<cmath>

#include<iomanip>

using namespace std;

char s[100010];

long long l,ans;

int main()

{

	cin>>s;

	l=strlen(s);

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

	{

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

		{

			ans++;

		} 

	}

    cout<<ans<<endl;

 	return 0;

}


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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

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

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

	return 0;

}


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

#include<cstdio>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<map>

using namespace std;

int main(){

	string s;

	int ans=0;

	cin>>s;

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

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

			ans++;

		}

	}

	cout<<ans<<endl;

	return 0;

}

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

#include<cstring>

#include<stdio.h>

using namespace std;

int main(){

	char a[100005];

	int ans=0;

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

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

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

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

	return 0;

}


// Fastest known solution for this problem: