You have n problems. You have estimated the difficulty of the i-th one as integer ci. Now you want to prepare a problemset for a contest, using some of the problems you've made.

A problemset for the contest must consist of at least two problems. You think that the total difficulty of the problems of the contest must be at least l and at most r. Also, you think that the difference between difficulties of the easiest and the hardest of the chosen problems must be at least x.

Find the number of ways to choose a problemset for the contest.

Input

The first line contains four integers n, l, r, x (1 ≤ n ≤ 15, 1 ≤ l ≤ r ≤ 109, 1 ≤ x ≤ 106) — the number of problems you have, the minimum and maximum value of total difficulty of the problemset and the minimum difference in difficulty between the hardest problem in the pack and the easiest one, respectively.

The second line contains n integers c1, c2, ..., cn (1 ≤ ci ≤ 106) — the difficulty of each problem.

Output

Print the number of ways to choose a suitable problemset for the contest. 

Examples

Input

3 5 6 1
1 2 3


Output

2


Input

4 40 50 10
10 20 30 25


Output

2


Input

5 25 35 10
10 10 20 10 20


Output

6

Note

In the first example two sets are suitable, one consisting of the second and third problem, another one consisting of all three problems.

In the second example, two sets of problems are suitable — the set of problems with difficulties 10 and 30 as well as the set of problems with difficulties 20 and 30.

In the third example any set consisting of one problem of difficulty 10 and one problem of difficulty 20 is suitable.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {

	
  static BufferedReader in;
  static PrintWriter out;
  static StringTokenizer tok;
  static void solve() throws Exception {
	  
	  int n = nextInt();
	  int l = nextInt();
	  int r = nextInt();
	  int x = nextInt();
	  int[] values = readIntArray(n);
	  
	  int res = 0;
	  for(int i = 0 ; i < (int)Math.pow(2, n); i++) {
		  int count = 0;
		  int max = Integer.MIN_VALUE;
		  int min = Integer.MAX_VALUE;
		  for(int j = 0 ; j < values.length ; j++) {
			  if( ((1<<j) & i) > 0) {
				  
				  count += values[j];
				  max = Math.max(max, values[j]);
				  min = Math.min(min, values[j]);
			  }
		  }
		  if( count >= l && count <=r && (max - min) >= x) {
			  res++;
		  }
	  }
	  System.out.println(res);
  }
  
  
  static int remove(String s) {
	  if(s.length() ==0)
		  return 0;
	  boolean found = false;
	  int index = 0;
	  for(int i = 0 ; i < s.length()-1 ; i++) {
		  if(s.charAt(i) =='0' && s.charAt(i+1) =='1') {
			  found = true;
		  }
		  if(s.charAt(i) =='1' && s.charAt(i+1) =='0') {
			  found = true;
		  }
		  if(found) {
			  index = i;
			  break;
		  }
	  }
	  if(!found)
		  return s.length();
	  
	  if(found && s.length() == 2)
		  return 0;
	  return remove(s.substring(0, index)+s.substring(index+2, s.length()));
	  
  }
  
  static void taste(int t[], int c[], int i, int j) {
	  
  }
  
  static String findDist(int r1, int c1, int n, int m, String []cave, int r2, int c2, String [][] mem) {
	  
	  if(r1 >=n || c1>=m || r1 <0 || c1 <0)
		  return "";
	  
	  if(cave[n].charAt(m) == 'X') 
		  return "";
	  
	  String value = "";
	  
	  if(r1 == r2 && c1 == c2) {
		  value = "YES";
		  return value;

	  }
	  
	  if(cave[n].charAt(m) == '.') 
		  return ".";

	  
	  String value1  = findDist(r1+1, c1, n,m, cave, r2, c2, mem);
	  String value2  = findDist(r1, c1+1, n,m, cave, r2, c2, mem);
	  String value3  = findDist(r1-1, c1, n,m, cave, r2, c2, mem);
	  String value4  = findDist(r1, c1-1, n,m, cave, r2, c2, mem);
	  
	  

	  return value;
  }

  public static void main(String args[]) {
    try {
      in = new BufferedReader(new InputStreamReader(System.in));
      out = new PrintWriter(new OutputStreamWriter(System.out));
      solve();
      in.close();
      out.close();
    } catch (Throwable e) {
      e.printStackTrace();
      System.exit(1);
    }
  }

  static int nextInt() throws IOException {
    return Integer.parseInt(next());
  }

  static int[] nextIntArray(int len, int start) throws IOException {
    int[] a = new int[len];
    for (int i = start; i < len; i++)
      a[i] = nextInt();
    return a;
  }

  static long nextLong() throws IOException {
    return Long.parseLong(next());
  }

  static long[] nextLongArray(int len, int start) throws IOException {
    long[] a = new long[len];
    for (int i = start; i < len; i++)
      a[i] = nextLong();
    return a;
  }

  static double nextDouble() throws IOException {
    return Double.parseDouble(next());
  }

  static double[] nextDoubleArray(int len, int start) throws IOException {
    double[] a = new double[len];
    for (int i = start; i < len; i++)
      a[i] = nextDouble();
    return a;
  }

  static BigInteger nextBigInteger() throws IOException {
    return new BigInteger(next());
  }

  static String next() throws IOException {
    while (tok == null || !tok.hasMoreTokens()) {
      tok = new StringTokenizer(in.readLine());
    }
    return tok.nextToken();
  }

  static String nextLine() throws IOException {
    tok = new StringTokenizer("");
    return in.readLine();
  }

  static void shuffleArray(long[] array) {
    Random random = new Random();
    for (int i = array.length - 1; i > 0; i--) {
      int index = random.nextInt(i + 1);
      long temp = array[index];
      array[index] = array[i];
      array[i] = temp;
    }
  }

  static boolean hasNext() throws IOException {
    while (tok == null || !tok.hasMoreTokens()) {
      String s = in.readLine();
      if (s == null) {
        return false;
      }
      tok = new StringTokenizer(s);
    }
    return true;
  }
  
  public static int[] readIntArray(int size) throws IOException {
      int[] result = new int[(int) size];
      for (int i = 0; i < size; i++) {
          result[(int) i] = (int)nextInt();
      }
      return result;
  }

}