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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.StringTokenizer;
import java.util.TreeSet;


public class B {

	static int[]sta;
	
	public static void main(String[] args) throws IOException {
	
		Scanner sc=new Scanner(System.in);	
		int n=sc.nextInt();
 String s=sc.nextLine();
 char c[]=s.toCharArray();
 char map1[]=new char[n];
 char map2[]=new char[n];
 char altr='r';char altr2='b';
 for (int i = 0; i < map2.length; i++) {
	map1[i]=altr;
	map2[i]=altr2;
	altr2=altr;
	altr=map2[i];
	
}
// System.out.println(Arrays.toString(map1));
 //System.out.println(Arrays.toString(map2));
 sta=new int[2];
 for (int i = 0; i < c.length; i++) {
	char d = c[i];
	char compare =map1[i];
	if(d!=compare){
	if(i+1<s.length())
		i+=check(d,compare,c[i+1],map1[i+1]);
sta[0]++;
//System.out.println(i);
}
 
}
		
 for (int i = 0; i < c.length; i++) {
	char d = c[i];
	char compare =map2[i];
	if(d!=compare){
	if(i+1<s.length())
		i+=check(d,compare,c[i+1],map2[i+1]);
	//System.out.println(i);
	sta[1]++;
}
 }
// System.out.println(sta[0]+"  "+sta[1]);
 System.out.println(Math.min(sta[0],sta[1]));
		
		
		
		
		
	}

	
	
	
	
public  static int check(char d, char c, char d1, char c2) {

	if(d1!=d)
	{
		if(d1!=c2)
			return 1;
			 //replace
		
	}
	return 0;
	
	
	
	
	
	
	
	}





static class Scanner 
{
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

	public String next() throws IOException 
	{
		while (st == null || !st.hasMoreTokens()) 
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {return Integer.parseInt(next());}
	
	public long nextLong() throws IOException {return Long.parseLong(next());}

	public String nextLine() throws IOException {return br.readLine();}
	
	public double nextDouble() throws IOException
	{
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if(x.charAt(0) == '-')
		{
			neg = true;
			start++;
		}
		for(int i = start; i < x.length(); i++)
			if(x.charAt(i) == '.')
			{
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			}
			else
			{
				sb.append(x.charAt(i));
				if(dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg?-1:1);
	}
	
	public boolean ready() throws IOException {return br.ready();}


}
}
