#include <bits/stdc++.h>
using namespace std;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

#define rep(i,n) for (int i = 0; i < n; ++i)
#define reps(i,s,n) for (int i = s; i < n; ++i)
#define rep1(i,n) for (int i = 1; i <= n; ++i)
#define per(i,n) for (int i = n - 1; i >= 0; --i)
#define per1(i,n) for (int i = n; i >= 1; --i)
#define all(c) begin(c),end(c)
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> inline T intceil(T a, T b) { return (a + (b - 1)) / b; }
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const long long MOD = 1e9+7;
#define precout() cout << std::fixed << std::setprecision(20);
const string alphabet = "abcdefghijklmnopqrstuvwxyz";
const int dy[4] = { 0, 1, 0, -1 };
const int dx[4] = { 1, 0, -1, 0 };
// if(nextY >= 0 && nextY < H && nextX >= 0 && nextX < W)
static const long double pi = acos(-1.0);
typedef complex<ld> cd;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll n,m,v,p; cin >> n >> m >> v >> p;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    sort(all(a));
    // debug(a);

    int lo = -1, hi = n - 1;
    while(hi - lo > 1) {
        int mid = (lo + hi) / 2;
        vector<ll> b;
        rep(i, n) {
            if(i != mid) {
                b.push_back(a[i]);
            }
        }
        reverse(all(b));

        ll base = a[mid] + m;
        ll ok = 0;

        bool ng = 0;
        rep(i, b.size()) {
            if(i < p - 1) ok += m;
            else if(base >= b[i]) ok += min(m, base - b[i]);
            else ng = 1;
        }

        // debug(mid, base, ok, b);

        if(ng || ok < (m * (v - 1))) {
            lo = mid;
        } else {
            hi = mid;
        }
    }

    cout << n - hi << endl;
}

/**
*    author:  souzai32
*    created: 12.08.2020 23:03:31
**/

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {

    int n;
    cin >> n;
    int a=(n+1)/2,b=n/2;
    vector<int> v(n),o(a),e(b);
    rep(i,n) cin >> v.at(i);
    rep(i,a) o.at(i)=v.at(2*i);
    rep(i,b) e.at(i)=v.at(2*i+1);

    // rep(i,a) cout << o.at(i) << endl;
    // rep(i,b) cout << e.at(i) << endl;

    sort(o.begin(),o.end());
    sort(e.begin(),e.end());

    int count=1;
    int on,en,co1=0,co2=0,ce1=0,ce2=0;

    rep(i,a){
        if(i==0) continue;
        else if(o.at(i)==o.at(i-1)) count++;
        else if(o.at(i)!=o.at(i-1)){
            if(count>=co1){
                co2=co1;
                co1=count;
                on=o.at(i-1);
            }
            else if(count>=co2){
                co2=count;
            }
            count=1;
        }
        if(i==a-1){
            if(count>=co1){
                co2=co1;
                co1=count;
                on=o.at(i);
            }
            else if(count>=co2){
                co2=count;
            }
            count=1;
        }
    }
    rep(i,b){
        if(i==0) continue;
        else if(e.at(i)==e.at(i-1)) count++;
        else if(e.at(i)!=e.at(i-1)){
            if(count>=ce1){
                ce2=ce1;
                ce1=count;
                en=e.at(i-1);
            }
            else if(count>=ce2){
                ce2=count;
            }
            count=1;
        }
        if(i==b-1){
            if(count>=ce1){
                ce2=ce1;
                ce1=count;
                en=e.at(i);
            }
            else if(count>=ce2){
                ce2=count;
            }
            count=1;
        }
    }

    int ans;
    if(on==en) ans=min(n-ce1-co2,n-co1-ce2);
    else ans=n-ce1-co1;

    // cout << co1 << ' ' << co2 << ' ' << ce1 << ' ' << ce2 << endl;
    cout << ans << endl;

    return 0;
}