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;

/**
 *
 * @author Loay mansour
 */
public class CodeForces {

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

        int n = sc.nextInt();
        String s = sc.next();
        int ans = 0;
        for (int i = 1; i < n; i++) {
            if (i < n - 1 && (s.charAt(i) == s.charAt(i - 1) && s.charAt(i) == s.charAt(i + 1))) {
                if (s.charAt(i) == 'b') {
                    StringBuilder temp = new StringBuilder(s);
                    temp.setCharAt(i, 'r');
                    s = temp.toString();
                } else {
                    StringBuilder temp = new StringBuilder(s);
                    temp.setCharAt(i, 'b');
                    s = temp.toString();
                }
                ans++;
            } else if (i < n - 1 && (s.charAt(i) == s.charAt(i - 1) && s.charAt(i) != s.charAt(i + 1))) {
                char next = s.charAt(i + 1);
                char curr = s.charAt(i);
                StringBuilder temp = new StringBuilder(s);
                temp.setCharAt(i, next);
                temp.setCharAt(i + 1, curr);
                s = temp.toString();
                ans++;

            }
        }

        System.out.println(ans);
    }

}