import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    B = sorted(A)
    target = B[(N - 1) // 2]
    for i in range(N):
        if A[i] == target:
            print(i)
            break


if __name__ == '__main__':
    main()
