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.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String s = in.next();
        char arr [] = s.toCharArray();
        
        
        int count = 0;
        for (int i = 1; i<s.length()-1; i++) {
            if (arr[i]==arr[i-1]){
                if (arr[i]==arr[i+1]) { 
                    if (arr[i-1]=='b'){ arr[i] = 'r';   }
                    else {  arr[i] = 'b';  }
                    count++;
                }
                else {  char temp = arr[i];
                        arr[i] = arr[i+1];
                        arr[i+1] = temp;
                        count ++ ;}
            }
        }
        
        System.out.println(count);
        
        
    }
}
