#include <bits/stdc++.h>
using namespace std;
int v[20], s[20], n, minimum, maximum, diff, contor;
int succesor(int k) {
  if (s[k] < 1) {
    s[k]++;
    return 1;
  }
  return 0;
}
int solutie(int k) { return k == n; }
void determina(int k) {
  int minn = INT_MAX, maxx = INT_MIN, suma = 0;
  for (int i = 1; i <= k; i++) {
    if (s[i] == 1) {
      suma += v[i];
      minn = min(minn, v[i]);
      maxx = max(maxx, v[i]);
    }
  }
  if (suma >= minimum && suma <= maximum && (maxx - minn) >= diff) {
    contor++;
  }
}
void back(int k) {
  s[k] = -1;
  while (succesor(k))
    if (solutie(k)) {
      determina(k);
      if (k < n) back(k + 1);
    } else
      back(k + 1);
}
int main() {
  cin >> n >> minimum >> maximum >> diff;
  for (int i = 1; i <= n; i++) cin >> v[i];
  back(1);
  cout << contor;
}
