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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B737 implements Runnable{
	static int N;
	static int[] list;
	static int[][] memo;
	public static void main(String[] args) {
		new Thread(null, new B737(), "cool", 1<<26).start();
	}
	

	private static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {br = new BufferedReader(new InputStreamReader(System.in));}
		String next(){
			while(st==null||!st.hasMoreElements()){
				try{st = new StringTokenizer(br.readLine());}
				catch(IOException e){e.printStackTrace();}
			}return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong(){return Long.parseLong(next());}
		double nextDouble(){return Double.parseDouble(next());}
	}
	@Override
	public void run() {
		MyScanner scan = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		N = scan.nextInt();
		list = new int[N];
		String line =scan.next();
		int[] o = new int[N+1], t = new int[N+1];
		for(int i=0;i<N;i++){
			list[i] = (line.charAt(i)=='b')?1:0;
		}
		
		int bit = 0, s1=0,s2=0;
		int zeroOff = 0, oneOff = 0;
		for(int i=0;i<N;i++){
			if(list[i]!=bit){
				if(bit==0){
					if(zeroOff>0){
						zeroOff--;
					}else{
						oneOff++;
						s1++;
					}
				}else{
					if(oneOff>0){
						oneOff--;
					}else{
						zeroOff++;
						s1++;
					}
				}
			}
			bit^=1;
		}
		bit=1;
		zeroOff=0;oneOff=0;
		for(int i=0;i<N;i++){
			if(list[i]!=bit){
				if(bit==0){
					if(zeroOff>0){
						zeroOff--;
					}else{
						oneOff++;
						s2++;
					}
				}else{
					if(oneOff>0){
						oneOff--;
					}else{
						zeroOff++;
						s2++;
					}
				}
			}
			bit^=1;
		}
		System.out.println(Math.min(s1, s2));
		out.close();
	}
}
