n = gets.to_i
strs = gets.chomp.split(' ').map(&:to_i)
if strs.uniq.size == 1
  puts n / 2
  exit
end
ans = 0
strs.each_with_index do |str, idx|
  break if idx == n-2
  ans += 1 if str != strs[idx + 2]
end
puts ans