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 class Main {

	public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
	while(sc.hasNext()){
		int n=sc.nextInt();
		String s1=sc.next();
		StringBuilder s=new StringBuilder(s1);
		int l=s.length();
		int count=0;
		int count2=0;
		char pre=s.charAt(0);
		for(int i=1;i<=l-1;i++){
			if(s.charAt(i)==pre){
				if(i==l-1){
					count++;
				}
				else if(s.charAt(i+1)!=pre){
						count++;
						s.setCharAt(i+1,pre);
						if(pre=='b')
						pre='r';
						else
						pre='b';
					}
				else if(s.charAt(i+1)==pre){
					count++;
					if(pre=='b')
						pre='r';
						else
						pre='b';
				}
			}
			else{
				if(pre=='b')
					pre='r';
					else
					pre='b';
			}
		}
		s=new StringBuilder(s1);
		//System.out.println(count);
		pre=s.charAt(l-1);
		for(int i=l-2;i>=0;i--){
			//System.out.println(s.charAt(i));
			//System.out.println(pre);
			if(s.charAt(i)==pre){
				if(i==0){
					count2++;
				}
				else if(s.charAt(i-1)!=pre){
						count2++;
						s.setCharAt(i-1,pre);
						if(pre=='b')
						pre='r';
						else
						pre='b';
					}
				else if(s.charAt(i-1)==pre){
					count2++;
					if(pre=='b')
						pre='r';
						else
						pre='b';
				}
			}
			else{
				if(pre=='b')
					pre='r';
					else
					pre='b';
			}
			//System.out.println(count2);
		}
		//System.out.println(count2);
		int jg=Math.min(count, count2);
		System.out.println(jg);
	}
	}
}
