stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 3.454920276023148x):
#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>

#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: 3.4159621797016686x):
#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 <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: 3.4583152716853895x):
#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 <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: 3.4833058075151198x):
#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>

#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: 3.5244956110113193x):
#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 <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: 3.4178010228123306x):
#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 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: 3.4159309514905765x):
#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 <cmath>

#include <list>

#include <algorithm>

#include <queue>





//g++ -std=c++11 IPL.cpp -o IPL

using namespace std;





int main(int argc, char**argv){

  string chips;

  cin >> chips;

  int num =0;

  int length = chips.size();

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

    if(chips[i] != chips[i+1]){

      num++;

    }else{

      continue;

    }









  }



  cout << num;



  return 0;

}

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



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0);

    string s; cin >> s;

    int res = 0;

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

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

    }

    cout << res << endl;

    return 0;

}


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

using namespace std;



int main () {

	string s;

	cin >> s;

	int ug = 1;

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

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

			ug++;

		}

	}

	cout << ug-1 << "\n";

	return 0;

}

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

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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

using namespace std;

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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include<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.269157503713901x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include <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.302994559003631x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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



using namespace std;



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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

using namespace std;



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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

using namespace std;



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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

using namespace std;

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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include<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.264820006276386x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include <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.205453263042629x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include <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.269993509470608x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include <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.30807562497325x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include <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.370843180857637x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:
#include <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.2082554052699335x):
#include<cstdio>

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}
// Slower C++ solution:


#include<bits/stdc++.h>

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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

#include <cmath>

#include <list>

#include <algorithm>

#include <queue>





//g++ -std=c++11 IPL.cpp -o IPL

using namespace std;





int main(int argc, char**argv){

  string chips;

  cin >> chips;

  int num =0;

  int length = chips.size();

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

    if(chips[i] != chips[i+1]){

      num++;

    }else{

      continue;

    }









  }



  cout << num;



  return 0;

}

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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

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

using namespace std;



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0);

    string s; cin >> s;

    int res = 0;

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

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

    }

    cout << res << endl;

    return 0;

}


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

#include<algorithm>

#include<cstring>

char str[100100];

int main()

{

	char a[5];

	while(scanf("%s",str+1)!=EOF)

	{

		int sum=0;

		int len=strlen(str+1);

		a[1]=str[len];	

		for(int i=len-1; i>=1; i--)

		{

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

			{

				a[1]=str[i];

				sum++;

			}

		}

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

	}

	return 0;

}