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

	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		String N = sc.next();
		int time1 = 0;
		int time2 = 0;
		char[] C = N.toCharArray();
		char[] X1 = new char[C.length];
		for (int i = 0; i < C.length; i += 2) {
			X1[i] = 'r';
			if (i != C.length - 1)
				X1[i + 1] = 'b';
		}
		char[] X2 = new char[C.length];
		for (int i = 0; i < C.length; i += 2) {
			X2[i] = 'b';
			if (i != C.length - 1)
				X2[i + 1] = 'r';
		}
		int a = 0, b = 0;
		for (int i = 0; i < C.length; i += 2) {
			if (C[i] != X1[i])
				a++;

			if (i != C.length - 1)
				if (C[i+1] != X1[i + 1])
					b++;

		}
		time1 = a > b ? a : b;
		a = 0;
		b = 0;
		for (int i = 0; i < C.length; i += 2) {
			if (C[i] != X2[i])
				a++;

			if (i != C.length - 1)
				if (C[i+1] != X2[i + 1])
					b++;

		}
		time2 = a > b ? a : b;
		if (time1 > time2)
			System.out.println(time2);
		else
			System.out.println(time1);
	}

}