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

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import java.util.Scanner;

/**
 *
 * @author tejas
 */
public class cockRoach {
    public static void main(String args[])
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        
        String[] a = new String[n];
        String inp = in.next();
        
        for(int i=0;i<n;i++)
        {
            a[i] = inp.substring(i, i+1);
        }
        
        int count = 0;
        for(int i=0;i<n-1;i++)
        {
            if(a[i].compareTo(a[i+1]) != 0)
                continue;
            else
            {
                if(i+2<=n-1)
                {
                    if(a[i+2].compareTo(a[i+1])!=0)
                    {
                       count++;
                       String temp = a[i+1];
                       a[i+1] = a[i+2];
                       a[i+2] = temp;
                       i++;
                    }
                    else
                    {
                       count++;
                       i++;
                    }
                }
                else
                {
                    count++;
                }
            }
        }
        
        System.out.println(count);
    }
    
}
