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.IOException;
import java.io.InputStreamReader;
public class Main {

    public static void main(String[] args) throws IOException {


        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());

        String[] roaches = br.readLine().split("");

        int i = 0;
        int sol = 0;

        while (i < roaches.length - 1) {

            if (!roaches[i].equals(roaches[i+1])) {
                i++;
            } else {

                if (i >= roaches.length - 2) {
                    sol++;
                    break;
                }

                if (roaches[i].equals(roaches[i+2])) {
                    sol++;
                    i += 2;
                } else {
                    sol++;
                    roaches[i+2] = roaches[i+1];
                    i += 2;
                }
            }
        }

        System.out.print(sol);
    }
}
	 		 	 	  	 										    		 	