#include <bits/stdc++.h>
using namespace std;
int N, K, X, Y, u, c[30];
long long S, a[30], ans, sum, fac[20];
unordered_map<long long, long long> x[30], y[30];
void go(int i, int e, bool t) {
  if (i == e) {
    if (!t)
      x[u][sum]++;
    else
      for (int j = u; j <= K; j++) y[j][sum]++;
  } else {
    c[i] = 0, go(i + 1, e, t);
    c[i] = 1, sum += a[i], go(i + 1, e, t), sum -= a[i];
    if (a[i] < 20)
      c[i] = 2, sum += fac[a[i]], u++, go(i + 1, e, t), u--, sum -= fac[a[i]];
  }
}
int main() {
  scanf("%d %d %lld", &N, &K, &S);
  for (int i = 0; i < (N); i++) scanf("%lld", &a[i]);
  for (int i = 0; i < (20); i++) fac[i] = i ? fac[i - 1] * i : 1;
  go(0, N / 2, 0), go(N / 2, N, 1);
  for (int j = 0; j < (K + 1); j++) {
    for (auto i : x[j]) {
      ans += i.second * y[K - j][S - i.first];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
