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.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;


public class Solution {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		StringTokenizer st;
		
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		char [] cockroaches = line.toCharArray();
		char [] cockroaches1 = line.toCharArray();
		
		int counter = 0;
		for(int i=1;i<cockroaches.length-1;i++){
			if(cockroaches[i] == cockroaches[i-1]){
				
				if(cockroaches[i+1] == cockroaches[i-1]){
					if(cockroaches[i] == 'b')
						cockroaches[i] = 'r';
					else
						cockroaches[i] = 'b';
				}else{
					char t = cockroaches[i];
					cockroaches[i] = cockroaches[i+1];
					cockroaches[i+1] = t;
				}
				
				counter++;
			}
		}
		
		int counter1 = 1;
		
		if(cockroaches1[0] == 'b')
			cockroaches1[0] = 'r';
		else
			cockroaches1[0] = 'b';
		
		for(int i=1;i<cockroaches1.length-1;i++){
			if(cockroaches1[i] == cockroaches1[i-1]){
				
				if(cockroaches1[i+1] == cockroaches1[i-1]){
					if(cockroaches1[i] == 'b')
						cockroaches1[i] = 'r';
					else
						cockroaches1[i] = 'b';
				}else{
					char t = cockroaches1[i];
					cockroaches1[i] = cockroaches1[i+1];
					cockroaches1[i+1] = t;
				}
				
				counter1++;
			}
		}
		
		System.out.println(Math.min(counter, counter1));
	}
}
