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.*;
import java.util.*;
public final class round_373_b
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	
	public static void main(String args[]) throws Exception
	{
		int n=sc.nextInt();char[] a=sc.next().toCharArray(),b=new char[n],c=new char[n];boolean curr=true;
		for(int i=0;i<n;i++)
		{
			if(curr)
			{
				b[i]='b';
			}
			else
			{
				b[i]='r';
			}
			curr=!curr;
		}
		curr=true;
		for(int i=0;i<n;i++)
		{
			if(curr)
			{
				c[i]='r';
			}
			else
			{
				c[i]='b';
			}
			curr=!curr;
		}
		//out.println(Arrays.toString(b)+" "+Arrays.toString(c));
		if(n==1)
		{
			out.println(0);
		}
		else
		{
			int val1=0,val2=0;
			for(int i=0;i<n;)
			{
				if(b[i]==a[i])
				{
					i++;continue;
				}
				if(i<n-1 && a[i]!=b[i] && a[i+1]!=b[i+1])
				{
					i+=2;val1++;continue;
				}
				else
				{
					val1++;i++;continue;
				}
			}
			for(int i=0;i<n;)
			{
				if(a[i]==c[i])
				{
					i++;continue;
				}
				if(i<n-1 && a[i]!=c[i] && a[i+1]!=c[i+1])
				{
					i+=2;val2++;continue;
				}
				else
				{
					val2++;i++;continue;
				}
			}
			out.println(Math.min(val1,val2));
		}
		out.close();
	}
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }
	
    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
	
	public String next() throws Exception {
		return nextToken().toString();
	}
	
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}