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

/**
 * Created by azati on 20.09.2016.
 */
public class test0001 {
    public static void main(String[] args) throws IOException {
        ArrayList<Character> list = new ArrayList<Character>();
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(reader.readLine());
        int k=0;
        String s=reader.readLine();
        for (int i=0;i<n;i++)
            list.add(s.charAt(i));
        for (int i=0;i<n-1;i++)
            if ((int)list.get(i)!=(int)list.get(i+1))
                k++;
        int p=chet(n-k-1);
        if (k==n-1)
            System.out.println(0);
        else
        {
            if (k>0)
                System.out.println(p/2);
            else
                System.out.println(n/2);
        }
        //System.out.println(k);
    }
    public static int chet(int a)
    {
        if (a%2==0)
            return a;
        else
            return a+1;
    }
}

