import scala.collection.mutable.ListBuffer
import scala.io.StdIn

object Main extends App {
  StdIn.readLine()
  val l = StdIn.readLine()
  var res = ListBuffer(l(0))
  for (i <- l){
    if(res.last != i) res += i
  }
  println(res.size)
}
