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.*;
import java.util.*;

public class Main {
    private final static InputReader ir = new InputReader(System.in);
    private final static OutputWriter ow = new OutputWriter(System.out, 0);
    private final static int INF = Integer.MAX_VALUE;
    private final static int NINF = Integer.MIN_VALUE;
    private final static double PI = Math.PI;

    public static void main(String[] args) throws IOException {
        try {
            task();
        } finally {
            boolean exc = false;
            try {
                ir.close();
            } catch (IOException e) {
                e.printStackTrace();
                exc = true;
            }
            try {
                ow.close();
            } catch (IOException e) {
                e.printStackTrace();
                exc = true;
            }
            if (exc) System.exit(1);
        }
    }

    private static void task() throws IOException {
        int n = ni(), l = ni(), r = ni(), x = ni();
        int[] c = new int[n];
        for (int i = 0; i < n; ++i) {
            c[i] = ni();
        }
        long ans = 0;
        for (int i = 3; i < 1 << n; ++i) {
            String v = Integer.toBinaryString(i);
            int min = INF, max = NINF;
            long sum = 0;

            for (int j = v.length() - 1; j >= 0; --j) {
                int e = (v.charAt(j) == '1' ? c[v.length() - 1 - j] : 0);
                if (e != 0 && e > max) max = e;
                if (e != 0 && e < min) min = e;
                sum += e;
            }
            if (sum >= l && sum <= r && max - min >= x) {
                //ow.println(sum + " " + min + " " + max);
                ++ans;
                //ow.println(new StringBuilder(v).reverse().toString());
            }

        }
        ow.print(ans);

    }

    private static int ni() {
        return ir.nextInt();
    }

    private static int nc() {
        return ir.nextChar();
    }

    private static String ns(int len) {
        return ir.nextLine(len);
    }

    private static long nl() {
        return ir.nextLong();
    }

    private static int max(int... objects) {
        if (objects.length == 0)
            throw new IllegalArgumentException("objects.length == 0");
        int max = objects[0];
        for (int i = 1; i < objects.length; ++i) {
            if (max < objects[i])
                max = objects[i];
        }
        return max;
    }

    private static int min(int... objects) {
        if (objects.length == 0)
            throw new IllegalArgumentException("objects.length == 0");
        int min = objects[0];
        for (int i = 1; i < objects.length; ++i) {
            if (min > objects[i])
                min = objects[i];
        }
        return min;
    }

    private static long pow(int x, int n) {
        if (x == 0) return 0;
        if (x == 1 || n == 0) return 1;
        if (x == 2) return x << (n - 1);
        if (n == 1) return x;
        long t = pow(x, n / 2);
        if (n % 2 == 0) return t * t;
        else return t * t * x;
    }

    private static double pow(double x, int n) {
        if (x == 0.0) return 0;
        if (x == 1.0 || n == 0) return 1;
        if (n == 1) return x;
        double t = pow(x, n / 2);
        if (n % 2 == 0) return t * t;
        else return t * t * x;
    }

    private static int abs(int a) {
        return (a >= 0 ? a : -a);
    }
}

class Pair<T, P> {
    T f;
    P s;

    Pair(T f, P s) {
        this.f = f;
        this.s = s;
    }
}

class Triple<T, P, V> {
    T f;
    P s;
    V t;
    Triple(T f, P s, V t) {
        this.f = f;
        this.s = s;
        this.t = t;
    }
}

class InputReader implements AutoCloseable {
    private final InputStream in;
    private int capacity;
    private byte[] buffer;
    private int len = 0;
    private int cur = 0;

    public InputReader(InputStream stream) {
        this(stream, 100_000);
    }

    public InputReader(InputStream stream, int capacity) {
        this.in = stream;
        this.capacity = capacity;
        buffer = new byte[capacity];
    }

    private boolean update() {
        if (cur >= len) {
            try {
                cur = 0;
                len = in.read(buffer, 0, capacity);
                if (len <= 0)
                    return false;
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        return true;
    }

    private int read() {
        if (update())
            return buffer[cur++];
        else return -1;
    }

    public boolean isEmpty() {
        return !update();
    }

    private boolean isSpace(int c) {
        return c == '\n' || c == '\t' || c == '\r' || c == ' ';
    }

    private boolean isEscape(int c) {
        return c == '\n' || c == '\t' || c == '\r' || c == -1;
    }

    private int readSkipSpace() {
        int c;
        do {
            c = read();
        } while (isSpace(c));
        return c;
    }

    public int nextInt() {
        int c = readSkipSpace();
        if (c < 0)
            throw new InputMismatchException();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c == -1) break;
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res = res * 10 + c - '0';
            if (res < 0)
                throw new InputMismatchException();
            c = read();
        } while (!isSpace(c));
        res *= sgn;
        return res;
    }

    public int[] getAllInts() {
        List<Integer> list = new LinkedList<>();
        while (true) {
            try {
                int t = nextInt();
                list.add(t);
            } catch (InputMismatchException e) {
                break;
            }
        }
        int[] a = new int[list.size()];
        Iterator<Integer> it = list.iterator();
        for (int i = 0; it.hasNext(); ++i)
            a[i] = it.next();
        return a;
    }

    public int[] getIntArray1D(int n) {
        int[] array = new int[n];
        for (int i = 0; i < n; ++i) {
            array[i] = nextInt();
        }
        return array;
    }

    public int[][] getIntArray2D(int n, int m) {
        int[][] array = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j)
                array[i][j] = nextInt();
        }
        return array;
    }

    public long nextLong() {
        int c = readSkipSpace();
        if (c < 0)
            throw new InputMismatchException();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c == -1) break;
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res = res * 10 + c - '0';
            if (res < 0)
                throw new InputMismatchException();
            c = read();
        } while (!isSpace(c));
        res *= sgn;
        return res;
    }

    public long[] getAllLongs() {
        List<Long> list = new LinkedList<>();
        while (true) {
            try {
                long t = nextLong();
                list.add(t);
            } catch (InputMismatchException e) {
                break;
            }
        }
        long[] a = new long[list.size()];
        Iterator<Long> it = list.iterator();
        for (int i = 0; it.hasNext(); ++i)
            a[i] = it.next();
        return a;
    }

    public long[] getLongArray1D(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; ++i) {
            array[i] = nextLong();
        }
        return array;
    }

    public long[][] getLongArray2D(int n, int m) {
        long[][] array = new long[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j)
                array[i][j] = nextLong();
        }
        return array;
    }

    public int nextChar() {
        int c = readSkipSpace();
        if (c < 0)
            throw new InputMismatchException();
        return c;
    }

    public String nextLine(int initialCapacity) {
        StringBuilder res = new StringBuilder(initialCapacity);
        int c = readSkipSpace();
        do {
            res.append((char) (c));
            c = read();
        } while (!isEscape(c));
        return res.toString();
    }

    @Override
    public void close() throws IOException {
        in.close();
    }
}

class OutputWriter implements Flushable, AutoCloseable {
    private byte[] buf;
    private final int capacity;
    private int count;
    private OutputStream out;

    public OutputWriter(OutputStream stream) {
        this(stream, 10_000);
    }

    public OutputWriter(OutputStream stream, int capacity) {
        if (capacity < 0)
            throw new IllegalArgumentException("capacity < 0");
        out = stream;
        this.capacity = capacity;
        if (capacity != 0) {
            buf = new byte[capacity];
        }
    }

    public void write(int b) throws IOException {
        if (capacity != 0) {
            if (count >= capacity)
                flushBuffer();
            buf[count++] = (byte) b;
        } else {
            out.write(b);
        }
    }

    public void write(byte[] bytes, int off, int len) throws IOException {
        if (capacity != 0) {
            if (len >= capacity) {
                flushBuffer();
                out.write(bytes, off, len);
                return;
            }
            if (len > capacity - count)
                flushBuffer();
            System.arraycopy(bytes, off, buf, count, len);
            count += len;
        } else out.write(bytes, off, len);
    }

    public void write(byte[] bytes) throws IOException {
        write(bytes, 0, bytes.length);
    }

    public void println() throws IOException {
        print("\n");
    }

    public void print(Object object) throws IOException {
        write(String.valueOf(object).getBytes());
    }

    public void println(Object object) throws IOException {
        print(object);
        println();
    }

    public void print(int... ints) throws IOException {
        print(" ", ints);
    }

    public void println(int... ints) throws IOException {
        print(ints);
        println();
    }

    public void println(String separator, int... ints) throws IOException {
        print(separator, ints);
        println();
    }

    public void print(String separator, int... ints) throws IOException {
        if (ints.length == 0) throw new IllegalArgumentException("ints.length == 0");
        for (int i = 0; i < ints.length; ++i) {
            if (i != 0) print(separator);
            print(ints[i]);
        }
    }

    private void flushBuffer() throws IOException {
        if (count > 0) {
            out.write(buf, 0, count);
            count = 0;
        }
    }

    @Override
    public void flush() throws IOException {
        flushBuffer();
        out.flush();
    }

    @Override
    public void close() throws IOException {
        flush();
        out.close();
    }
}