#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 * 100 + 10;
int a[30];
long long fact[20];
unordered_map<long long, int> M[30];
int main() {
  int n, k;
  long long s;
  scanf("%d%d%lld", &n, &k, &s);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  fact[1] = 1;
  for (int i = 2; i <= 18; i++) fact[i] = fact[i - 1] * i;
  set<long long> t;
  for (int mask = 0; mask < (1 << (n / 2)); mask++) {
    for (int submask = mask;; submask = (submask - 1) & mask) {
      bool ok = true;
      long long cur = 0;
      int cnt = 0;
      for (int i = 0; i < n / 2; i++) {
        if ((submask >> i) & 1) {
          if (a[i] >= 19) {
            ok = false;
            break;
          }
          cur += fact[a[i]];
          cnt++;
        } else {
          if ((mask >> i) & 1) cur += a[i];
        }
        if (cur > s) {
          ok = false;
          break;
        }
      }
      if (!ok) {
        if (submask == 0) break;
        continue;
      }
      M[cnt][cur]++;
      t.insert(cur);
      if (submask == 0) break;
    }
  }
  long long answer = 0;
  for (int mask = 0; mask < (1 << (n / 2 + n % 2)); mask++) {
    for (int submask = mask;; submask = mask & (submask - 1)) {
      bool ok = true;
      long long cur = 0;
      int cnt = 0;
      for (int i = 0; i < n / 2 + n % 2; i++) {
        if ((submask >> i) & 1) {
          if (a[i + n / 2] >= 19) {
            ok = false;
            break;
          }
          cur += fact[a[i + n / 2]];
          cnt++;
        } else {
          if ((mask >> i) & 1) cur += a[i + n / 2];
        }
        if (cur > s) {
          ok = false;
          break;
        }
      }
      if (!ok || !t.count(s - cur)) {
        if (submask == 0) break;
        continue;
      }
      for (int i = 0; i <= k - cnt; i++) {
        answer += M[i][s - cur];
      }
      if (submask == 0) break;
    }
  }
  printf("%lld\n", answer);
  return 0;
}
