#include <iostream>
using namespace std;
int m[37];
int main() {
int n, a, ans;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> m[i];
cin >> a;
if (a == n)
ans = 1;
else if (a == 1)
ans = 0;
else if (m[a - 1] > m[a + 1])
ans = 0;
else
ans = 1;
if (ans == 1) {
while (a >= 1 && m[a] >= m[a - 1]) {
a--;
if (a - 1 < 1)
break;
}
}
if (ans == 0) {
while (a <= n && m[a] >= m[a + 1]) {
a++;
if (a + 1 > n)
break;
}
}
if (a == 0)
a++;
if (a == n + 1)
a--;
cout << a << endl;
}