local n = io.read("*n")
local cur = io.read("*n")
local ren = 1
local ret = 0
for i = 2, n do
  local a = io.read("*n")
  if(a == cur) then
    ren = ren + 1
  else
    ret = ret + ren // 2
    ren = 1
    cur = a
  end
end
ret = ret + ren // 2
print(ret)
