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.*;
public class test{
    public static String reverseString(String s){
        String result="";
        for (int i=s.length()-1;i>=0;i--){
            result = result+s.charAt(i);
        }
        return result;
    }
    public static void main(String[] args) {
        int n;
        String s;
        Scanner input=new Scanner(System.in);
        n=input.nextInt();
        s=input.next();
        final char red='r';
        final char black='b';
        char[] array = reverseString(s).toCharArray();
        System.out.println(array);
        int counter=0;
        for (int i=1;i<n;i++){
             if (array[i]!=array[i-1]){
                 continue;
             }else {
                 if (i < n - 1) {
                     if (array[i] != array[i + 1]) {
                         char temp = array[i];
                         array[i] = array[i + 1];
                         array[i + 1] = temp;
                         counter++;
                     } else {
                         if (array[i - 1] == black) {
                             array[i] = red;
                         } else {
                             array[i] = black;
                         }
                         counter++;
                     }
                 }else {
                     if (array[i]==array[i-1]){
                         array[i]=array[i-1]==black? red:black;
                         counter++;
                     }
                 }
             }
        }
        System.out.print(counter);
    }
}