import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()

    var way = 0
    var pre = 0
    var ans = 1

    for (i in 0 until n) {
        val now = sc.nextInt()
        if (i == 0 || now - pre == 0) {
        } else if (way == 0) {
            way = sgn(now - pre)
        } else if (sgn(now - pre) != way) {
            ans++
            way = 0
        }
        pre = now
    }
    println(ans)
}

fun sgn(x: Int): Int {
    if (x == 0) {
        return 0
    }
    if (x > 0) {
        return 1
    }
    return -1
}
