#include <stdio.h>


int main(void){

        int n;
        scanf("%d",&n);
        char s[n][11];

        for(int i=0;i<n;i++){
                scanf("%s",s[i]);
        }   

        for(int i=0;i<n-1;i++){
                if(s[i] != s[i+1]){
                        count++;
                        for(int j=i+1;j<n;j++){
                                if(s[j] == s[i+1]){
                                        s[j] = s[i];
                                }   
                        }   
                }   
        }   
        printf("%d\n",count);
return 0;
}