N = gets.to_i
C = N.times.map{ gets.to_i }

def color(c)
	top = c.shift
	count = 0
	flag = false

	return 1 if c.empty?

	c.each{|col|
		if (top == col) && (flag) then
			count = count + 1
			flag = false
		elsif top != col then
			flag = true
		end
	}

	return color(c) + count 
end

puts color(C)
