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 Ejercicio2 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		String s1 = s.next();
		
		int min1 =0;
		//black
		boolean black = true;
		for (int j = 0; j < s1.length();j++) {
			if(black){
				if(s1.charAt(j)!='b'){
					if(j<s1.length()-1 && s1.charAt(j+1)=='b'){
						
						min1++;
						j++;
						black=!black;
						
					}else{
						min1++;
					}
				}
			}else{
				if(s1.charAt(j)!='r'){
					if(j<s1.length()-1 && s1.charAt(j+1)=='r'){
						
						min1++;
						j++;
						black=!black;
						
					}else{
						min1++;
					}
					
				}
			}
			
			black=!black;
		}
		
		int min2 =0;
		//black
		black = false;
		for (int j = 0; j < s1.length();j++) {
			if(black){
				if(s1.charAt(j)!='b'){
					if(j<s1.length()-1 && s1.charAt(j+1)=='b'){
						
						min2++;
						j++;
						black=!black;
						
					}else{
						min2++;
					}
				}
			}else{
				if(s1.charAt(j)!='r'){
					if(j<s1.length()-1 && s1.charAt(j+1)=='r'){
						
						min2++;
						j++;
						black=!black;
						
					}else{
						min2++;
					}
					
				}
			}
			
			black=!black;
		}
		System.out.println(Math.min(min1, min2));
	}
}
