def main():
    N = int(input())
    H = [int(n) for n in input().split()]

    maxHeight = max(H)
    counter = 1
    for i, v in enumerate(H):
        if i == 0:
            continue
        if v < maxHeight:
            counter += 1
        elif v == maxHeight:
            break

    for i, v in enumerate(H):
        if i == 0:
            continue
        if v == maxHeight:
            counter += 1

    print(counter)


if __name__ == '__main__':
    main()
