number=gets.to_i point_cnt=gets.chomp point=point_cnt.split.map(&:to_i) even_dis=0 odd_dis=0 (point.size-1).times do|i| if(point[i]+point[i+1])%2==1 odd_dis+=1 else even_dis+=1 end end if odd_dis>even_dis print (odd_dis-(even_dis+1)) else print (even_dis-(odd_dis+1)) end