package capitialize;
import java.util.Scanner;
public class Capitialize {
public static void main(String[] args) {
Scanner in= new Scanner(System.in); char[] st =new char[50]; int i,w,res=0; w=in.nextInt(); for(i=0;i<w;i++){ st[i]=in.next().charAt(0); if(i>0){if(st[i]==st[i-1]){res++;}}
} System.out.println(res); } }