#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"n=int(input())\n"
"a=list(map(int,input().split()))\n"
"i=0\n"
"l=0\n"
"while True:\n"
"    if i>n-1:break\n"
"    j=i\n"
"    while j<n-1 and a[j+1]==a[j]:\n"
"        j+=1\n"
"    l+=(j-i+1)//2\n"
"    i=j+1\n"
"print(l)\n"
"\"";
  system(s);
  return 0;
}            