stablegradients/pie-gem5-pairs huggingface dataset:
// 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.381818296198816x):
#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 <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.2188982786278615x):
#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 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.216042725616767x):
#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>

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.205826253878476x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.205469237473213x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.203906665731661x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.205826253878476x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.266345742044652x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.300164740987614x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.226517017087176x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.202523024807562x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.205811039744918x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.205501012377385x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.262010559210378x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.202675495639439x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.267181301686598x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.305243095566176x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.367977157024256x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.205476142569611x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

}
// 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.2026279335646635x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

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

using namespace std;

char S[100055], T[100055];

using namespace std;

int main() {

	scanf("%s", S);

	n = strlen(S);

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

		if(S[i] != S[i-1]) ++l;

	}

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

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

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

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

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

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

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

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

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

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

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

}