// Peaks

func main() {
    let nm = readLine()!.split(separator: " ").map{Int($0)!}
    let h = ("0 " + readLine()!).split(separator: " ").map{Int($0)!}
    var flugs: [Bool] = Array(repeating: true, count: nm[0] + 1)
    flugs[0] = false
    print(flugs.filter{$0}.count.description)
}

main()