#include <bits/stdc++.h>
using namespace std;
void print(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
long long int power1(long long int x) {
  long long int u = 0;
  while (x % 2 == 0) {
    u++;
    x = x / 2;
  }
  return u;
}
long long int powM(long long int x, long long int y, long long int m) {
  if (m == 1) {
    return 0;
  }
  long long int ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
int powm(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t1 = 1;
  long long int M = 1e9 + 7;
  while (t1--) {
    long long int n, d, m;
    cin >> n >> d >> m;
    long long int a[n];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    reverse(a, a + n);
    vector<long long int> v, v1;
    for (long long int i = 0; i < n; i++) {
      if (a[i] <= m) {
        v.push_back(a[i]);
      } else {
        v1.push_back(a[i]);
      }
    }
    long long int x, y;
    x = v.size();
    y = v1.size();
    for (long long int i = 1; i < x; i++) {
      v[i] = v[i] + v[i - 1];
    }
    for (long long int i = 1; i < y; i++) {
      v1[i] = v1[i] + v1[i - 1];
    }
    long long int u = -1;
    if (y != 0) {
      long long int mn = (n - x) / (d + 1);
      long long int mx = n / (d + 1);
      for (long long int i = 0; i < x + 1; i++) {
        long long int u1 = 0;
        if (i != 0) {
          u1 += v[i - 1];
          long long int p = (n - i) / (d + 1);
          if ((n - i) % (d + 1) != 0) {
            p++;
          }
          p = min(p, y);
          u1 += v1[p - 1];
        } else {
          long long int p = (n - i) / (d + 1);
          if ((n - i) % (d + 1) != 0) {
            p++;
          }
          p = min(p, y);
          u1 += v1[p - 1];
        }
        u = max(u, u1);
      }
    } else {
      u = v[x - 1];
    }
    cout << u;
  }
  return 0;
}
