http://codeforces.com/problemset/problem/266/A
import java.util.Scanner;
public class Stones_on_the_Table {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n =scanner.nextInt();
char[] ch = scanner.next().toCharArray();
int count = 0;
int index = 1;
for(int i = 0; i < n-1; i++) {
if(ch[i] == ch[i+1]) {
index++;
} else {
if(index > 1) count += index - 1;
index = 1;
}
}
if(index > 1) count += index - 1;
System.out.println(count);
}
}