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.DataInputStream;
import java.io.IOException;
import java.util.Scanner;

public class Anatoly {
		static int min(int x, int y, int z) {
		if (x < y && x < z)
			return x;
		if (y < x && y < z)
			return y;
		else
			return z;
	}

	static int editDistDP(String str1, String str2, int m, int n) {
		// Create a table to store results of subproblems
		int dp[][] = new int[m + 1][n + 1];

		// Fill d[][] in bottom up manner
		for (int i = 0; i <= m; i++) {
			for (int j = 0; j <= n; j++) {
				// If first string is empty, only option is to
				// isnert all characters of second string
				if (i == 0)
					dp[i][j] = j; // Min. operations = j

				// If second string is empty, only option is to
				// remove all characters of second string
				else if (j == 0)
					dp[i][j] = i; // Min. operations = i

				// If last characters are same, ignore last char
				// and recur for remaining string
				else if (str1.charAt(i - 1) == str2.charAt(j - 1))
					dp[i][j] = dp[i - 1][j - 1];

				// If last character are different, consider all
				// possibilities and find minimum
				else
					dp[i][j] = 1 + min(dp[i][j - 1], // Insert
							dp[i - 1][j], // Remove
							dp[i - 1][j - 1]); // Replace
			}
		}
		return dp[m][n];
	}

	public static int findCount(String str1, String str2) {
		String str = str1;
		String findStr = str2;
		int lastIndex = 0;
		int count = 0;
		while (lastIndex != -1) {
			lastIndex = str.indexOf(findStr, lastIndex);
			if (lastIndex != -1) {
				count++;
				lastIndex += findStr.length();
			}
		}
		return count;
	}

	public static void main(String[] args) throws Exception {
		//Reader in = new Reader();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		char r = 'r';
		char b = 'b';
		String str1 = sc.next();
		if (str1.length() == 1)
			System.out.println(0);

		else if (str1.length() % 2 == 0) {
			int rCnt = findCount(str1, "r");
			int bCnt = findCount(str1, "b");

			//if (rCnt - bCnt != 0) {
				char tmp[] = new char[n];
				for (int i = 0; i < n; i = i + 2) {
					tmp[i] = 'r';
				}
				for (int i = 1; i < n; i = i + 2) {
					tmp[i] = 'b';
				}
				String tmpStr1 = new String(tmp);
				int tmpCnt1 = editDistDP(str1, tmpStr1, str1.length(),
						tmpStr1.length());
				for (int i = 0; i < n; i = i + 2) {
					tmp[i] = 'b';
				}
				for (int i = 1; i < n; i = i + 2) {
					tmp[i] = 'r';
				}
				String tmpStr2 = new String(tmp);
				int tmpCnt2 = editDistDP(str1, tmpStr2, str1.length(),
						tmpStr2.length());
				if (tmpCnt1 < tmpCnt2)
					System.out.println(tmpCnt1);
				else
					System.out.println(tmpCnt2);

			//} else {

			//}
		} 
	else {
			int rCnt = findCount(str1, "r");
			int bCnt = findCount(str1, "b");
			//System.out.println(str1);
			//System.out.println(" "+bCnt);
			//if (Math.abs(rCnt - bCnt) == 1) {
				char tmp[] = new char[n];
				if (rCnt > bCnt) {
					for (int i = 0; i < n; i = i + 2) {
						tmp[i] = 'r';
					}
					for (int i = 1; i < n; i = i + 2) {
						tmp[i] = 'b';
					}
				} else {
					for (int i = 0; i < n; i = i + 2) {
						tmp[i] = 'b';
					}
					for (int i = 1; i < n; i = i + 2) {
						tmp[i] = 'r';
					}
				}

				String tmpStr1 = new String(tmp);
				System.out.println(editDistDP(str1, tmpStr1, str1.length(),
						tmpStr1.length()));
			//}
		}
	}
}