int main()
{
int j; cin >> j;
int k, h=0,g=0;
char A[50];
cin >> A;
for(int a=0;A[a]!='\0';a++)
{
if (A[a] == 66)k = 1; else if (A[a] == 71)k = 2; else k = 3;
if (k == h)g++; h = k;
}cout << g;
return 0;
}
int main()
{
int j; cin >> j;
int k, h=0,g=0;
char A[50];
cin >> A;
for(int a=0;A[a]!='\0';a++)
{
if (A[a] == 66)k = 1; else if (A[a] == 71)k = 2; else k = 3;
if (k == h)g++; h = k;
}cout << g;
return 0;
}