Have you ever used the chat application QQ? Well, in a chat group of QQ, administrators can muzzle a user for days.

In Boboniu's chat group, there's a person called Du Yi who likes to make fun of Boboniu every day.

Du will chat in the group for n days. On the i-th day:

  * If Du can speak, he'll make fun of Boboniu with fun factor a_i. But after that, he may be muzzled depending on Boboniu's mood. 
  * Otherwise, Du won't do anything. 



Boboniu's mood is a constant m. On the i-th day:

  * If Du can speak and a_i>m, then Boboniu will be angry and muzzle him for d days, which means that Du won't be able to speak on the i+1, i+2, ⋅⋅⋅, min(i+d,n)-th days. 
  * Otherwise, Boboniu won't do anything. 



The total fun factor is the sum of the fun factors on the days when Du can speak.

Du asked you to find the maximum total fun factor among all possible permutations of a.

Input

The first line contains three integers n, d and m (1≤ d≤ n≤ 10^5,0≤ m≤ 10^9).

The next line contains n integers a_1, a_2, …,a_n (0≤ a_i≤ 10^9).

Output

Print one integer: the maximum total fun factor among all permutations of a.

Examples

Input


5 2 11
8 10 15 23 5


Output


48


Input


20 2 16
20 5 8 2 18 16 2 16 16 1 5 16 2 13 6 16 4 17 21 7


Output


195

Note

In the first example, you can set a'=[15, 5, 8, 10, 23]. Then Du's chatting record will be:

  1. Make fun of Boboniu with fun factor 15. 
  2. Be muzzled. 
  3. Be muzzled. 
  4. Make fun of Boboniu with fun factor 10. 
  5. Make fun of Boboniu with fun factor 23. 



Thus the total fun factor is 48.
import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.*;

public class Solution{
    static char s[][];
    static int n , m;
   
    static boolean visited[][];
    static void insert(int x , trie head , int i) {
    	if(((x >> i) & 1) == 1) {
    		if(head.a[1] == null) {
    			head.a[1] = new trie();
    			head = head.a[1];
    			head.cnt++;
    		}
    		else
    			head.cnt++;
    		insert(x , head , i + 1);
    	}
    	else {
    		if(head.a[0] == null) {
    			head.a[0] = new trie();
    			head = head.a[0];
    			head.cnt++;
    		}
    		else
    			head.cnt++;
    		insert(x , head , i + 1);
    	}
    }
  /*  
    public int search(int x , trie head , int ans) {
    	if(head == null) return ans;

    }
   */
    public void solve () throws IOException  {
       
        
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = in.nextInt();
        int d = in.nextInt();
        long m =in.nextLong();
        long a[] = new long [n];
        for(int i = 0 ; i <  n ; i++)
        	a[i] = in.nextLong();
        
        PriorityQueue<Long>bad = new PriorityQueue<>();
        PriorityQueue<Long>good = new PriorityQueue<>(Collections.reverseOrder());
        long goodSum = 0L;
        long badSum = 0L;
        for(int i = 0 ; i < n ; i++) {
        	if(a[i] > m) {
        		bad.add(a[i]);
        		badSum += a[i];
        	}
        	else {
        		goodSum += a[i];
        		good.add(a[i]);
        	}
        }
        if(badSum == 0 ) {
        	pw.println(goodSum);
        	pw.flush();
        	pw.close();
        	return ;
        }
        long can = n / (d + 1);
        long rem = n % (d + 1);
        if(rem > 0) {
        	can ++;
        	rem --;
        }
        can = Math.min(can, bad.size());
        
        if(can > 0)
        rem = n - (can - 1) * (d + 1) - 1;
        while(!bad.isEmpty() && bad.size() > can) {
        	badSum -= bad.poll();
        }
        long ans = 0L;
        while(rem > 0 && !good.isEmpty()) {
        	ans += good.poll();
        	rem --;
        }
        long fi = ans + badSum;
        while(can > 0 && !good.isEmpty() && !bad.isEmpty()) {
        	int count = d + 1;
        	
        	while(!good.isEmpty() && count > 0) {
        		ans += good.poll();
        		count--;
        	}
        	if(!bad.isEmpty())
        		badSum -= bad.poll();
        	fi = Math.max(fi , ans + badSum);
        }
        pw.println(fi);
        pw.flush(); 
        pw.close();
    }
    static class trie{
    	int cnt;
    	trie a [] = new trie[2];
    
    }
    public static void main(String[] args) throws Exception {
        
         
        new Thread(null,new Runnable() {
            public void run() {
                  try {
                    new Solution().solve();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }  
        },"1",1<<26).start();
        
        
    }
   
    static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
        }
        
        static class InputReader 
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) 
        {
            this.stream = stream;
        }
        public int snext() 
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) 
            {
                curChar = 0;
                try 
                {
                    snumChars = stream.read(buf);
                } 
                catch (IOException e) 
                {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() 
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do 
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public long nextLong()
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') 
            {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do 
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) 
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) 
            {
                a[i] = nextInt();
            }
            return a;
        }
 
        public String readString()
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public String nextLine() 
        {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) 
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) 
        {
            return c == '\n' || c == '\r' || c == -1;
        }
 
        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;
        public void extended(int a,int b) {
            if(b==0) {
                d=a;
                p=1;
                q=0;
            }
            else
            {
                extended(b,a%b);
                int temp=p;
                p=q;
                q=temp-(a/b)*q;
            }
        }
       
        
        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }
        
        public static long[] shuffle(long[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                long temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }
        
        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }
        
        public static HashSet<Integer> primeFactorization(int n)
        {
            HashSet<Integer> a =new HashSet<Integer>();
            for(int i=2;i*i<=n;i++)
            {
                while(n%i==0)
                {
                    a.add(i);
                    n/=i;
                }
            }
            if(n!=1)
                a.add(n);
            return a;
        }
        
        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;
            
            isPrime[0] = false;
            isPrime[1] = false;
            
            for(int i=2;i*i<n;i++)
            {
                if(isPrime[i] == true)
                {
                    for(int j=(2*i);j<n;j+=i)
                        isPrime[j] = false;
                }
            }
        }
        
        public static long GCD(long n,long m)
        {
            if(m==0)
                return n;
            else
                return GCD(m,n%m);
        }
        public static long LCM (long a,long b) {
            return ((a*b)/(GCD(a,b)));
        }
        
        static class pair implements Comparable<pair>
        {
            Integer x , y ;
            
            pair(int  x, int y )
            {
                this.x=x;
                this.y=y;
            }

           
            public int compareTo(pair o) {
                int result = x.compareTo(o.x);
                if(result==0)
                    result = y.compareTo(o.y);
                
                return result;
            }  
            
            public String toString()
            {
                return x+" "+y;
            }
            
            public boolean equals(Object o)
            {
                if (o instanceof pair)
                {
                    pair p = (pair)o;
                    return p.x == x && p.y == y ;
                }
                return false;
            }
            public int hashCode()
            {
                return x.hashCode()*3 +  y.hashCode();
                
            }
        }
        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }
        
       
        
        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }
        
        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }
        
        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }
        
        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }
        
       
        
                    
         
}
