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

}

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

} 

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

}

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

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;

}

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

}

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

}

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

{

	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;

}

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

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;

}

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

}

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

#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.05809462380897x):
#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;

}
// 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.168342275574489x):
#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;

}
// 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.058280671083528x):
#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;

}
// 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.05504185224263x):
#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;

}
// 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.000501735922902x):
#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;

}
// 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.0551674891965295x):
#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;

}
// 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.058280671083528x):
#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;

}
// 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.0573826902441406x):
#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;

}
// 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.036817888698649x):
#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;

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

}

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

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

} 

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

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

}

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

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

}

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

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

}

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

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

}

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

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

}

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

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

}

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

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

}

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

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

}

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

}
// 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.0023334071192425x):
#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;

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

}

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

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

    return 0;

}

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

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

}

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

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

}

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

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

}


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

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

}

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

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

#include <cstring>

using namespace std;



string s;

int pos,ans;



int main()

{

	cin>>s;

	pos=s.size()-1;

	

	while(pos>=0)

	{

		int cur=pos;

		while(s[cur]==s[pos]&&pos>=0) pos--;

		ans++;

	}

	

	cout<<ans-1;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.197469280362358x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

char a[100001];

int main()

{

	int n;

	scanf("%d",&n);

	scanf("%s",a);

	int len=strlen(a);

	int ans=0; 

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

	{

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

		ans++;

	}

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

	return 0;

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



using namespace std;



int main(){

    int ans = 0;

    string inp;

    cin >> inp;

    for(int one = 1; one < inp.size(); one++){

        if(inp[one] != inp[one-1]){

            ans++;

        }

    }

    cout << ans;

}


// Faster C++ solution for the same problem (measured speedup: 5.280993055808502x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

char a[100001];

int main()

{

	int n;

	scanf("%d",&n);

	scanf("%s",a);

	int len=strlen(a);

	int ans=0; 

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

	{

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

		ans++;

	}

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

	return 0;

}