#include <bits/stdc++.h>
using namespace std;
void dout() { cerr << endl; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << H << ' ';
  dout(T...);
}
mt19937 rnd(4477);
void solve() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  int n, d, m;
  cin >> n >> d >> m;
  vector<int> a, b;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (x <= m) {
      a.push_back(x);
    } else {
      b.push_back(x);
    }
  }
  if ((int)b.size() == 0) {
    for (int i = 0; i < (int)a.size(); ++i) {
      ans += a[i];
    }
    cout << ans << "\n";
    return 0;
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<long long> sum((int)b.size());
  for (int i = 0; i < (int)b.size(); ++i) {
    sum[i] = b[i];
    if (i) {
      sum[i] += sum[i - 1];
    }
  }
  int kol = (n + d) / (d + 1);
  dout("ans", ans);
  if (kol > 0) ans = sum[min((int)sum.size() - 1, kol - 1)];
  dout("ans", ans);
  long long p = 0;
  for (int i = 0; i < (int)a.size(); ++i) {
    p += a[i];
    int kol = (n + d - (i + 1)) / (d + 1);
    ans = max(ans, p);
    if (kol > 0) {
      ans = max(ans, p + sum[min((int)sum.size() - 1, kol - 1)]);
    }
  }
  cout << ans << "\n";
  return 0;
}
