#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int N, D, E, A[20]; vector<pair<long long, long long> > v1[3]; vector<long long> seg[3][1111111];
int query(int s, int a, int b, long long x, int k, int l, int r) {
if(r <= a || b <= l) return 0;
if(a <= l && r <= b) return upper_bound(seg[s][k].begin(), seg[s][k].end(), x + D) - lower_bound(seg[s][k].begin(), seg[s][k].end(), x - D);
int lc = query(s, a, b, x, 2 * k, l, (l + r) / 2);
int rc = query(s, a, b, x, 2 * k + 1, (l + r) / 2, r);
return lc + rc;
}
void rec(int pos, long long x1, long long x2, int xe) {
if(pos == N) { v1[xe].push_back(make_pair(x1, x2)); return; }
rec(pos + 1, x1 + A[pos], x2 + A[pos], xe);
rec(pos + 1, x1 - A[pos], x2, xe);
rec(pos + 1, x1, x2 - A[pos], xe);
if(xe < E) rec(pos + 1, x1, x2, xe + 1);
}
long long solve(int pos, long long x1, long long x2, int xe) {
long long ret = 0;
if(pos == N / 2) {
for(int i = 0; i <= E - xe; i++) {
int pl = lower_bound(v1[i].begin(), v1[i].end(), make_pair(-x1 - D, -1LL << 60)) - v1[i].begin();
int pr = lower_bound(v1[i].begin(), v1[i].end(), make_pair(-x1 + D + 1, -1LL << 60)) - v1[i].begin();
ret += query(i, pl, pr, -x2, 1, 0, 524288);
}
return ret;
}
ret += solve(pos + 1, x1 + A[pos], x2 + A[pos], xe);
ret += solve(pos + 1, x1 - A[pos], x2, xe);
ret += solve(pos + 1, x1, x2 - A[pos], xe);
if(xe < E) ret += solve(pos + 1, x1, x2, xe + 1);
return ret;
}
int main() {
scanf("%d%d%d", &N, &D, &E);
for(int i = 0; i < N; i++) scanf("%d", &A[i]);
rec(N / 2, 0, 0, 0);
for(int i = 0; i <= E; i++) sort(v1[i].begin(), v1[i].end());
for(int i = 0; i <= E; i++) {
for(int j = 0; j <= v1[i].size(); j++) {
int k = j + 524288;
while(k > 0) seg[i][k].push_back(v1[i][j].second), k >>= 1;
}
for(int j = 1; j < 524288; j++) {
if(seg[i][j].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