import java.util.Scanner

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val mountains = parseList(sc, n)
    val result = greatViewingCount(mountains.first(), mountains)
    println(result)
}

private fun parseList(scanner: Scanner, length: Int): List<Int> {
    return (0 until length).map {
        scanner.nextInt()
    }
}

private fun greatViewingCount(threshold: Int, mountains: List<Int>): Int {
    val filteredMountains = mountains.filter { threshold >= it }
    val max = filteredMountains.max()!!
    return filteredMountains.indexOfLast { it == max } + 1
}
