#include <bits/stdc++.h>
using namespace std;
long long n, k, s;
int a[30] = {};
long long fact[20] = {};
long long pows[15] = {};
unordered_map<long long, int> cnt[26];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k >> s;
  long long cur = 1;
  for (int i = 1;; i++) {
    cur *= i;
    if (cur <= (long long)1e16) {
      fact[i] = cur;
    } else {
      break;
    }
  }
  for (int i = 0; i < n; i++) cin >> a[i];
  int half = (n + 1) / 2;
  int st = 1;
  for (int i = 0; i <= half; i++) {
    pows[i] = st;
    st *= 3;
  }
  for (int i = 0; i < pows[half]; i++) {
    long long curk = 0, cursum = 0;
    vector<int> cur;
    int t = i;
    for (int j = 0; j < half; j++) {
      cur.push_back(t % 3);
      t /= 3;
    }
    bool noans = false;
    for (int j = 0; j < half; j++) {
      if (cur[j] == 0) continue;
      if (cur[j] == 1) cursum += a[j];
      if (cur[j] == 2) {
        if (a[j] >= 19)
          noans = true;
        else {
          cursum += fact[a[j]];
          curk++;
        }
      }
    }
    if (!noans && curk <= k && cursum <= s) {
      cnt[curk][cursum]++;
    }
  }
  long long ans = 0;
  int len = n - half;
  for (int i = 0; i < pows[len]; i++) {
    long long curk = 0, cursum = 0;
    vector<int> cur;
    int t = i;
    for (int j = 0; j < len; j++) {
      cur.push_back(t % 3);
      t /= 3;
    }
    bool noans = false;
    for (int j = 0; j < len; j++) {
      if (cur[j] == 0) continue;
      if (cur[j] == 1) cursum += a[j + half];
      if (cur[j] == 2) {
        if (a[j + half] >= 19)
          noans = true;
        else {
          cursum += fact[a[j + half]];
          curk++;
        }
      }
    }
    if (!noans && curk <= k && cursum <= s) {
      for (int tmp = k; tmp >= 0; tmp--) {
        if (tmp - curk < 0) break;
        if (cnt[tmp - curk].count(s - cursum))
          ans += cnt[tmp - curk][s - cursum];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
