#include <stdio.h>
#include <stdlib.h>


int main(void){
    // Your code here!
    int n;
    int i;
    int count =0;
    scanf("%d",&n);
    int v[n];
    for(i=0;i<n;i++){
        scanf("%d",&v[i]);
        if(i>1&&i%2==1){
            if(v[i]!=v[1]){
                count++;
            }
        }else if(i>1&&i%2!=1){
            if(v[i]!=v[0]){
                count++;
            }
        }
    }
    printf("%d",count);
    
    return 0;
}


