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.*;
import java.io.*;
public class B{
	public static void main(String[] args){
		InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int num=in.nextInt();
        String str=in.readString();
        int count=0;
        for(int i=0;i<num;i++){
        	if(str.charAt(i)=='b'){
        		count++;
        	}
        	if(str.charAt(i)=='r'){
        		count--;
        	}
        }
        if(Math.abs(count)==num){
        	System.out.println((int)Math.abs(count/2));

        }
        else{
        	int ans=0;
        	StringBuilder str1=new StringBuilder(str);
        	char prev=str1.charAt(0);
	        for(int i=1;i<num-1;i++){
	        	int flag=0;
	        	if(i+1<=num-1){
		        	if(flag==0&&prev=='r'&&str1.charAt(i)=='r'&&str1.charAt(i+1)=='b'){
		        		ans++;
		        		str1.setCharAt(i,'b');
		        		str1.setCharAt(i+1,'r');
		        		flag=1;
		        		//System.out.println("Inside 1");
		        	}
		        	else if(flag==0&&prev=='b'&&str1.charAt(i)=='b'&&str1.charAt(i+1)=='r'){
		        		ans++;
		        		str1.setCharAt(i,'r');
		        		str1.setCharAt(i+1,'b');
		        		flag=1;
		        		//System.out.println("Inside 2 "+i);
		        	}
	        	}
	        	if(flag==0&&prev=='b'&&str1.charAt(i)=='b'){
	        		ans++;
	        		str1.setCharAt(i,'r');
	        		flag=1;
	        		//System.out.println("Inside 3 "+i);
	        	}
	        	if(flag==0&&prev=='r'&&str1.charAt(i)=='r'){
	        		ans++;
	        		str1.setCharAt(i,'b');
	        		flag=1;
	        		//System.out.println("Inside 4");
	        	}
	        	prev=str1.charAt(i);
	        }
	        System.out.println(ans);
        }
		w.close();
	}
	
	static class InputReader {
 
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
 
        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }
        public long[] nextLongArray(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }
 
        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}  