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.*;
import java.io.*;
import java.math.*;
public class Test{
	public static void main(String[] args){		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String so = sc.next();
		StringBuffer s = new StringBuffer(so);
		int answer  = 0;
		for(int i=1;i<n-1;i++){
			if(s.charAt(i)!=s.charAt(i-1))
				continue;
			else if(s.charAt(i)==s.charAt(i+1)){
				if(s.charAt(i)=='b')
					s.replace(i,i+1,Character.toString('r'));
				else
					s.replace(i,i+1,Character.toString('b'));
				answer++;
			}
			else{
				char temp = s.charAt(i+1);
				s.replace(i+1,i+2,Character.toString(s.charAt(i)));
				s.replace(i,i+1,Character.toString(temp));
				answer++;
			}
		}
		if(s.charAt(n-2)==s.charAt(n-1))
			answer++;
		System.out.println(answer);
	}
}