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;

/**
 * Created by Pedro on 23/9/2016.
 */
public class Solution {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int cant = sc.nextInt();
        String str = sc.next();
        char arr[] = str.toCharArray();

        int cantR = 0, cantB = 0;
        for (int i = 0; i < cant; i++) {
            if (arr[i] == 'b')  cantB++;
            else cantR++;
        }
        int cantMoves = 0;
        char c = arr[0];
        for (int i = 1; i < cant; i++) {
            if (arr[i] == c) {
                int a = canSwap(arr, i);
                System.out.println(a);
                if (a != -1) swap(arr, i, a);
                else paint(arr, i);
                cantMoves++;
            }
            c = arr[i];
        }
        System.out.println(cantMoves);

    }

    static void paint(char arr[], int i) {
        if (arr[i] == 'b') arr[i] = 'r';
        else arr[i] = 'b';
    }

    static void swap(char arr[], int a, int b) {
        char aux = arr[a];
        arr[a] = arr[b];
        arr[b] = aux;
    }

    static int canSwap(char arr[], int i) {
        char c = arr[i];
        for (int j = i+1; j < arr.length; j+=2) {
            if(arr[j] != c) return j;
        }
        return -1;
    }

}
