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;

/**
 * Created by Kim on 2016-09-23.
 */
public class Main {

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

        int n = sc.nextInt();
        String str = sc.next();

        int count = 0;

        char first = str.charAt(0);

        for(int i=1; i<str.length()-1; i++) {
            if(first == str.charAt(i)) {
                count++;
                i++;
            } else {
                if(str.charAt(i) != str.charAt(i+1)) {
                    i++;
                } else {
                    first = str.charAt(i);
                }
            }
        }
        int count2=0;
        first = str.charAt(0) == 'r' ? 'b':'r';
        count2++;
        for(int i=1; i<str.length()-1; i++) {
            if(first == str.charAt(i)) {
                count2++;
                i++;
            } else {
                if(str.charAt(i) != str.charAt(i+1)) {
                    i++;
                } else {
                    first = str.charAt(i);
                }
            }
        }

        System.out.println(Math.min(count,count2));
    }
}
