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.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;

public class Contest {
	static PrintWriter out = new PrintWriter(System.out);

	static final Random random = new Random();

	public static void main(String[] args) throws FileNotFoundException {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int b = 0, r = 0;
		char[] a = sc.next().toCharArray();

		for (int i = 0; i < n; i++) {
			b += a[i] == 'b' ? 1 : 0;
			r += a[i] == 'r' ? 1 : 0;
		}
		if(Math.abs(b-r) <= 1) {
			System.out.println((solve3(a.clone(), n)+1)/2);
			return;
		}
		out.println(Math.min(solve1(a.clone(),n),  solve2(a.clone(), n)));
		out.flush();
	}
	static int solve3(char[] a, int n) {
		int res1 = 0, res2 = 0;
		
		for(int i = 0;i < n;i++) {
			if(i%2 == 0) {
				if(a[i] != 'b')
					res1++;
				else
					res2++;
			} else {
				if(a[i] != 'r')
					res1++;
				else
					res2++;
			}
			
		}
		
		return Math.min(res1, res2);
	}
	static int solve1(char[] a, int n) {
		int res = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (a[i] != 'b') {
					res++;
					if (i + 1 < n && a[i + 1] == 'b') {
						char tmp = a[i];
						a[i] = a[i + 1];
						a[i + 1] = tmp;
					} else
						a[i] = 'b';
				}
			} else {
				if (a[i] != 'r') {
					res++;
					if (i + 1 < n && a[i + 1] == 'r') {
						char tmp = a[i];
						a[i] = a[i + 1];
						a[i + 1] = tmp;
					} else
						a[i] = 'r';
				}
			}
		}
		return res;
	}
	
	static int solve2(char[]a, int n) {
		int res = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 != 0) {
				if (a[i] != 'b') {
					res++;
					if (i + 1 < n && a[i + 1] == 'b') {
						char tmp = a[i];
						a[i] = a[i + 1];
						a[i + 1] = tmp;
					} else
						a[i] = 'b';
				}
			} else {
				if (a[i] != 'r') {
					res++;
					if (i + 1 < n && a[i + 1] == 'r') {
						char tmp = a[i];
						a[i] = a[i + 1];
						a[i + 1] = tmp;
					} else
						a[i] = 'r';
				}
			}
		}
		return res;
	}

	static void Arrayssort(int[] a) {
		int n = a.length;// shuffle, then sort
		for (int i = 0; i < n; i++) {
			int oi = random.nextInt(n);
			int temp = a[oi];
			a[oi] = a[i];
			a[i] = temp;
		}
		java.util.Arrays.sort(a);
	}

	private static class Scanner {
		public BufferedReader reader;
		public StringTokenizer st;

		public Scanner(InputStream file) throws FileNotFoundException {
			reader = new BufferedReader(new InputStreamReader(file));
			st = null;
		}

		public String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					String line = reader.readLine();
					if (line == null)
						return null;
					st = new StringTokenizer(line);
				} catch (Exception e) {
					throw (new RuntimeException());
				}
			}
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() throws IOException {
			return reader.readLine();
		}
	}

}