166
rbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb
 7
rrbrbrb
 1
r
 2
bb
 18
rrrrrrrrrrrrrrrrrb
 8
rbbrbrbr
 1
b
 13
rbbbrbrrbrrbb
 100
brbbbrrrbbrbrbbrbbrbbbbrbbrrbbbrrbbbbrbrbbbbbbbbbbbbbbbbrrrrbbbbrrrbbbbbbbrbrrbrbbbbrrrbbbbrbbrbbbrb
 2
rb
 2
rr
 2
br

70
 1
 0
 1
 8
 1
 0
 3
 34
 0
 1
 0



import java.io.BufferedReader;
import java.io.InputStreamReader;

public class CF_719B_AnatolyAndCockroaches {
public static void main(String[]args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	boolean [] taken = new boolean [n];
	char [] arr = br.readLine().toCharArray();
	int RedChange = 0 ;
	int BlueChange = 0 ;
	for(int i =1 ; i<n-1;i++){
		if(arr[i-1]=='b'&&arr[i]=='b'&&!taken[i-1]){
			taken[i] = true ;
			BlueChange ++;
		}
		
		if(arr[i-1]=='r'&&arr[i]=='r'&&!taken[i-1]){
			taken[i] = true ;
			RedChange ++;
		}
	}
	System.out.println(Math.max(BlueChange, RedChange));
}


}
