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

import javax.print.attribute.HashAttributeSet;

import java.io.*;

public class B {
	public static void main(String[] args) {
		new B().solve();
	}

	FasterScanner in = new FasterScanner();
	PrintWriter out = new PrintWriter(System.out);

	long mod = (long) 1e9 + 7;

	public void solve() {
		int n =in.nextInt();
		char[] a= in.nextLine().toCharArray();
		int r=0;
		int b=0;
		char last = a[0];
		for(int i=1;i<n;i++) {
			if(a[i]==last) {
				if(a[i]=='r'){
					r++;
					last = 'b'; 
				} else {
					b++;
					last = 'r';
				}
			}
			else {
				last = a[i];
			}
		}
		int ans = Math.min(r, b);
		ans += r-Math.min(r, b);
		ans += b-Math.min(r, b);
		
		r = 0;
		b = 0;
		last = a[0];
		for(int i=0;i<n;i++) {
			if(a[i]==last) {
				if(a[i]=='r'){
					r++;
					last = 'b'; 
				} else {
					b++;
					last = 'r';
				}
			}
			else {
				last = a[i];
			}
		}
		
		int ans2 = Math.min(r, b);
		ans2 += r-Math.min(r, b);
		ans2 += b-Math.min(r, b); 
		out.print(Math.min(ans, ans2));
		out.close();
	}

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		private boolean isSpaceChar(int c) {
			return c == '\n' || c == '\r' || c == -1 || c == ' ' || c == '\t';
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}

			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

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

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public int[] nextIntArray10(int n) {
			int[] arr = new int[n + 1];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray10(int n) {
			long[] arr = new long[n + 1];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public int[] nextIntArray11(int n) {
			int[] arr = new int[n + 2];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray11(int n) {
			long[] arr = new long[n + 2];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}
	}

}