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.Scanner;

public class ka2 {

	public static void main(String[] args){
		
		Scanner in = new Scanner(System.in);
	
		int n = in.nextInt();
		in.nextLine();
		String line = in.nextLine();
		
		char[] arr= line.toCharArray();
		int c = 0;
		
		for(int i = 1;i<n;i++){
			if(arr[i] == arr[i-1]){
				try{
					if(arr[i] != arr[i+1]){
						char a = arr[i+1];
						arr[i+1] = arr[i];
						arr[i] = a;
						i++;
					}else{
						if(arr[i] == 'r')
							arr[i] = 'b';
						else
							arr[i] = 'r';
						
						i++;
							
					}
					c++;
				}catch(Exception e){
					c++;
				}
			}
		}
		
		System.out.println(c);
		
//		for(int i = 0;i<n;i++){
//			System.out.println(arr[i]);
//		}
		
	}
}
