#include <bits/stdc++.h>
using namespace std;
int a[2][22];
long long F[20];
long long getFact(int x) {
  if (x > 18) return (1LL << 54);
  return F[x];
}
long long sum[1 << 15], sum_fact[1 << 15];
vector<long long> v[2][26];
int k;
long long s;
void process(int n, int id) {
  long long aux;
  sum[0] = sum_fact[0] = 0;
  for (int i = 1, j; i < (1 << n); i++) {
    j = 31 - __builtin_clz(i);
    sum[i] = sum[i ^ (1 << j)] + a[id][j];
    if (sum[i] > (1LL << 54)) sum[i] = (1LL << 54);
    sum_fact[i] = sum_fact[i ^ (1 << j)] + getFact(a[id][j]);
    if (sum_fact[i] > (1LL << 54)) sum_fact[i] = (1LL << 54);
  }
  int num;
  for (int i = 0; i < (1 << n); i++) {
    if (sum[i] <= s) v[id][0].push_back(sum[i]);
    for (int j = i; j > 0; j = (j - 1) & i) {
      aux = sum[i ^ j] + sum_fact[j];
      num = __builtin_popcount(j);
      if (num > k) continue;
      if (aux <= s) v[id][num].push_back(aux);
    }
  }
}
int main() {
  F[0] = 1;
  for (int i = 1; i <= 18; i++) F[i] = F[i - 1] * i;
  int n;
  while (cin >> n >> k >> s) {
    for (int i = 0; i < n / 2; i++) cin >> a[0][i];
    for (int i = n / 2; i < n; i++) cin >> a[1][i - n / 2];
    process(n / 2, 0);
    process(n - n / 2, 1);
    for (int i = 0; i <= k; i++) sort(v[1][i].begin(), v[1][i].end());
    long long ans = 0;
    for (int j = 0; j <= k; j++) {
      for (int l = 0; l <= k - j; l++) {
        for (int i = 0; i < v[0][l].size(); i++) {
          ans += upper_bound(v[1][j].begin(), v[1][j].end(), s - v[0][l][i]) -
                 lower_bound(v[1][j].begin(), v[1][j].end(), s - v[0][l][i]);
        }
      }
    }
    cout << ans << endl;
  }
}
