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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            String cockroach = in.next();
            int count = 0;
            StringBuilder cockroaches = new StringBuilder(cockroach);
            for (int i = 1; i < n; i++) {

                if (cockroaches.charAt(i) == cockroaches.charAt(i - 1)) {
                    if (i == n - 1) {//if previous is same and this is the last character, change colors
                        cockroaches.setCharAt(i, reverse(cockroaches.charAt(i)));
                        count++;
                    }//all 3 same, change current color
                    else if (cockroaches.charAt(i) == cockroaches.charAt(i + 1)) {
                        cockroaches.setCharAt(i, reverse(cockroaches.charAt(i)));
                        count++;
                    } else {//first two same, last is different, so swap
                        char temp = cockroaches.charAt(i);
                        cockroaches.setCharAt(i, cockroaches.charAt(i + 1));
                        cockroaches.setCharAt(i + 1, temp);
                        count++;


                    }

                }
            }
            out.println(count);
        }

        public char reverse(char a) {
            if (a == 'b') {
                return 'r';
            } else {
                return 'b';
            }
        }

    }
}

