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

public class B {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("input.txt")));
		int[] original, redFirst, blackFirst;
		int n = Integer.parseInt(br.readLine().split(" ")[0]);
		String input = br.readLine().split(" ")[0];
		original = new int[n];
		redFirst = new int[n];
		blackFirst = new int[n];
		boolean[] errorFoundRF = new boolean[n];
		boolean[] errorFoundBF = new boolean[n];
		for (int i = 0; i < n;++i) {
			redFirst[i] = i % 2;
			blackFirst[i] = i % 2 + 1;
			if (input.charAt(i) == 'r'){
				original[i] = 0;
			} else {
				original[i] = 1;
			}
			errorFoundRF[i] = original[i] != redFirst[i];
			errorFoundBF[i] = original[i] != blackFirst[i];
		}
		int countRF = 0, countBF = 0;
		for (int i = 0; i < n; ++i) {
			if (errorFoundRF[i]){
				if( i < n-1 && errorFoundRF[i+1] ){
					errorFoundRF[i+1] = false;
				}
				errorFoundRF[i] = false;
				countRF++;
			} 
			if (errorFoundBF[i]){
				if( i < n-1 && errorFoundBF[i+1] ){
					errorFoundBF[i+1] = false;
				}
				errorFoundBF[i] = false;
				countBF++;
			} 
			
		}
		int min = countBF < countRF ? countBF : countRF;
		System.out.println(min);
		
	}

}
