object Main extends App {
  import scala.io.StdIn.{readInt, readLine}
  val _ = readInt()
  val numbers = readLine().split(' ').map(_.toInt)

  val Array(first, second) = numbers.take(2)
  val tail = numbers.tail.tail

  val suggestedChangeSize = if (first == second) {
    0
  } else {
    tail.zipWithIndex.count {
      case (number, i) =>
        if (i == 0) number == first
        else if (i % 2 == 0) number == first
        else number == second
    }
  }

  println(suggestedChangeSize)
}