#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, target, p;
  cin >> n >> target >> p;
  vector<int> v;
  while (n--) {
    int d;
    cin >> d;
    v.push_back(d);
  }
  v.push_back(target);
  sort(v.begin(), v.end());
  int iCount = 1;
  for (auto cp = v.rbegin(); cp != v.rend(); ++cp) {
    int temp = *cp;
    if (temp == target) {
      if (p <= iCount) {
        auto t = ++cp;
        if (t != v.rend() && *t == temp) break;
      }
      cout << iCount;
      return 0;
    }
    if (p <= iCount++) break;
  }
  cout << "-1";
  return 0;
}
