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.lang.*;
import java.io.*;
import java.math.*;
 
public class Main{
    public static int mod=(int)Math.pow(10,9)+7;
    public static void main (String[] args) throws java.lang.Exception{
        //BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);
        int n=in.readInt();
        String s=in.readString();
        char[][] c=new char[2][n];
        c[0]=s.toCharArray();
        c[1]=s.toCharArray();
        int r=0,b=0;
        //0 starts with r, 1 with b
        for(int i=0;i<n;i++){
            if(i==n-1){
                if(i%2==0){
                    if(c[1][n-1]=='r')
                        b++;
                }else{
                    if(c[0][n-1]=='b')
                        r++;
                }
                break;
            }
            if(i%2==0){
                if(c[1][i]=='r'){
                    if(c[1][i+1]=='b'){
                        c[1][i+1]='r';
                        c[1][i]='b';
                    }
                    b++;
                }
                if(c[0][i]=='b'){
                    if(c[0][i+1]=='r'){
                        c[0][i+1]='b';
                        c[0][i]='r';
                    }
                    r++;
                }
            }else{
                if(c[1][i]=='b'){
                    if(c[1][i+1]=='r'){
                        c[1][i+1]='b';
                        c[1][i]='r';
                    }
                    b++;
                }
                if(c[0][i]=='r'){
                    if(c[0][i+1]=='b'){
                        c[0][i+1]='r';
                        c[0][i]='b';
                    }
                    r++;
                }
            }
        }
        out.println(Math.min(r,b));
        out.close();
    }
    static final class InputReader{
        private final InputStream stream;
        private final byte[] buf=new byte[1024];
        private int curChar;
        private int numChars;
        public InputReader(InputStream stream){this.stream=stream;}
        private int read()throws IOException{
            if(curChar>=numChars){
                curChar=0;
                numChars=stream.read(buf);
                if(numChars<=0)
                    return -1;
            }
            return buf[curChar++];
        }
        public final int readInt()throws IOException{return (int)readLong();}
        public final long readLong()throws IOException{
            int c=read();
            while(isSpaceChar(c)){
                c=read();
                if(c==-1) throw new IOException();
            }
            boolean negative=false;
            if(c=='-'){
                negative=true;
                c=read();
            }
            long res=0;
            do{
                if(c<'0'||c>'9')throw new InputMismatchException();
                res*=10;
                res+=(c-'0');
                c=read();
            }while(!isSpaceChar(c));
            return negative?(-res):(res);
        }
        public final int[] readIntBrray(int size)throws IOException{
            int[] arr=new int[size];
            for(int i=0;i<size;i++)arr[i]=readInt();
            return arr;
        }
        public final String readString()throws IOException{
            int c=read();
            while(isSpaceChar(c))c=read();
            StringBuilder res=new StringBuilder();
            do{
                res.append((char)c);
                c=read();
            }while(!isSpaceChar(c));
            return res.toString();
        }
        public final String readLine()throws IOException{
            int c=read();
            while(isSpaceChar(c))c=read();
            StringBuilder res=new StringBuilder();
            do{
                res.append((char)c);
                c=read();
            }while(!isSpaceChar(c));
            return res.toString();
        }
        private boolean isSpaceChar(int c){
            return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
        }
    }
}