#include <bits/stdc++.h>

using namespace std;
string t,s;
int br=0;
int main(){
   cin>>t>>s;
   for (int i=1;i<=s.size()-2;i++){
      br=0;
      if (s[i]!=s[i-1] and s[i]!=s[i+1]){
         br++;
      }
   }
   cout<<br<<endl;
   return 0;
}