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 c {
	public static void main(String args[])
	{
		Scanner get=new Scanner(System.in);
		int n;
	    n=get.nextInt();
	    get.nextLine();
	    String s;
	   	s=get.nextLine();
	   	int count1=0,count2=0;
	   	char a='r';
	   	int countr=0,countb=0;
	   	for(int i=0;i<s.length();i++)
	   	{
	   		if(s.charAt(i)!=a)
	   		{
	   			if(s.charAt(i)=='b')
	   				countb++;
	   			else
	   				countr++;
	   		}
	   		if(a=='r')
	   			a='b';
	   		else
	   			a='r';
	   	}
	   	int min=Math.min(countr,countb);
	   //	System.out.println(countr+" "+countb);
	   	count1+=min;
	   	countr-=min;
	   	countb-=min;
	   	count1+=(countr+countb);
	   	a='b';
	   	countr=0;countb=0;
	   	for(int i=0;i<s.length();i++)
	   	{
	   		if(s.charAt(i)!=a)
	   		{
	   			if(s.charAt(i)=='b')
	   				countb++;
	   			else
	   				countr++;
	   		}
	   		if(a=='r')
	   			a='b';
	   		else
	   			a='r';
	   	}
	    min=Math.min(countr,countb);
	   	count2+=min;
	   	countr-=min;
	   	countb-=min;
	   	count2+=(countr+countb);
	   	System.out.println(Math.min(count1,count2));
	}
}
