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

		}

	}*/

}

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

#include <cstring>

#include <algorithm>

#include <cmath>

#include <vector>

#include <queue>

using namespace std;

typedef long long LL;

typedef long double DD;

const int inf = 1e9;

const int mo= 1e9+7;

const int N = 200010;

char s[N];





int main(){

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

	int n=strlen(s+1);

	int ans=0;

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

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

			ans++;

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

	return 0;

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

}

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

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

}

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

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

}

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

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

}




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

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

}

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

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

}

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

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

}

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

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

}

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

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

}




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

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

}

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

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

}

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

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

}

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

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

		}

	}*/

}

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

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

}

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

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

}

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

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

}


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

}
// Slower C++ solution:


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







}


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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}




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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}




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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

		}

	}*/

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

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

}

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

#include<algorithm>

#include<cstring>



using namespace std;



int n,m;

char c[100005];



int main() {

	scanf("%s", c);

	n = strlen(c);

	for (int i = n - 1; i > 0; i--) {

		if (c[i] != c[i - 1]) m++;

	}

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

}