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.*;

public class Solution
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		char com1[]=new char[n];
		char com2[]=new char[n];
		for(int i=0;i<n;i++)
		{
			if(i%2==1)
			{
				com1[i]='r';
				com2[i]='b';
			}
			else
			{
				com1[i]='b';
				com2[i]='r';
			}
		}
		String str=br.readLine();
		char arr[]=str.toCharArray();
		int red=0,black=0,x=0,y=0;
		for(int i=0;i<n;i++)
		{
			if(arr[i]!=com1[i])
			{
				if(arr[i]=='r')
					red++;
				else
					black++;
			}
			if(arr[i]!=com2[i])
			{
				if(arr[i]=='r')
					x++;
				else
					y++;
			}
		}
		System.out.println(Math.min(Math.max(x,y),Math.max(red,black)));
	}		
}