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


public class a373b {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String ss = sc.next();
        int limit = ss.length();
        char next='z' , prev= 'z';
        int count = 0;
        ArrayList<Character> s = new ArrayList<Character>();
        for (int i = 0; i < limit; i++) {
            s.add(ss.charAt(i));
        }
        for (int i = 0; i < limit; i++) {
            next = s.get(i);
            if (i==0) {
                prev = next;
                continue;
            }
            if (i==limit-1) {
                if (prev == next) {
                    count++;
                }
                continue;
            }
            if (prev==next) {
                if (next==s.get(i+1)) {
                    count++;
                   
                    if (next=='r') {
                        s.set(i, 'b');
                    }
                    else    {
                        s.set(i, 'r');
                    }
                    //System.out.println(i+"iiiiiiiiiiiii"+s);
                    prev = s.get(i);
                    continue;
                }
                else{
                    count++;
                    char temp = s.get(i+1);
                    s.set(i+1, s.get(i));
                    s.set(i, temp);
                    prev = s.get(i);
                    //System.out.println(i+"iiiiiiiiiiiiii");
                    continue;
                }
            }
            prev = s.get(i);
        }
        
        System.out.println(count);
    }
}
