#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int n, q, k;
int main() {
  int i, j;
  cin >> n >> k >> q;
  for (i = 0; i < n; i++) {
    cin >> j;
    v.push_back(j);
  }
  sort(v.begin(), v.end());
  j = 1000000000;
  for (i = 0; i <= n - k; i++) {
    j = min(j, v[i + k - 1] - v[i]);
  }
  cout << i << endl;
  return 0;
}
