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.util.Scanner;

public class B373 {

	static char ar[];
	static boolean last = false;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); sc.nextLine();
		String str = sc.nextLine();
		ar = str.toCharArray();
		//System.out.println(ar.length);
		int res=0;
		if(n==1)
			res=0;
		else if(str.indexOf('b')==-1 || str.indexOf('r')==-1){
			res=n/2;
		}
		else{
			last=false;
			for(int i=1;i<n;i++){
				if(ar[i]==ar[i-1] && !last){
					ar[i]=change(ar[i]);
					res++;
					last=true;
				}else if(ar[i]==ar[i-1] && last){
					ar[i]=change(ar[i]);
					last=false;
				}else{
					last=false;
				}
			}
			int res2=0;
			ar = str.toCharArray();
			last=false;
			for(int i=n-2;i>=0;i--){
				if(ar[i]==ar[i+1] && !last){
					ar[i]=change(ar[i]);
					res2++;
					last=true;
				}else if(ar[i]==ar[i+1] && last){
					ar[i]=change(ar[i]);
					last=false;
				}else{
					last=false;
				}
			}
			res=Math.min(res, res2);
		}
		
		System.out.println(res);
		
	}

	
	public static char change(char c){
		if(c=='r')
			return 'b';
		else
			return 'r';
		
	}
	
}
