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.*;
import java.util.*;

public class B {
	
	public static void main(String[] args) throws IOException {
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		String line = in.next();
		int[] ps = new int[line.length()];
		for(int i=0;i<ps.length;i++) {
			ps[i] = line.charAt(i) == 'r' ? 0 : 1;
		}
		int par = 0;
		int sum = 0;
		for(int i=0;i<line.length();i++) {
			if(ps[i] == par) {
				par = 1-par;
				continue;
			}
			if(i != ps.length-1 && ps[i+1] == par) {
				i ++;
				sum++;
				continue;
			}
			par = 1-par;
			sum++;
		}
		int ans = sum;
		sum = 0;
		par = 1;
		for(int i=0;i<line.length();i++) {
			if(ps[i] == par) {
				par = 1-par;
				continue;
			}
			if(i != ps.length-1 && ps[i+1] == par) {
				i ++;
				sum++;
				continue;
			}
			par = 1-par;
			sum++;
		}
		ans = Math.min(ans, sum);
		out.println(ans);
		out.close();
	}
	

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}

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

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

		public String next() throws IOException {
			while (!st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}
	}
}