#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll fact[20], a[26], n, k, S;
unordered_map<ll, ll> num_ways[2][26];
void rec(ll sum, ll used, ll cur_i, ll max_i, ll half) {
  if (cur_i == max_i and sum <= S) {
    ++num_ways[half][used][sum];
    return;
  }
  if (cur_i == max_i or sum > S or used > k) return;
  rec(sum + a[cur_i], used, cur_i + 1, max_i, half);
  rec(sum, used, cur_i + 1, max_i, half);
  if (a[cur_i] < 19)
    rec(sum + fact[a[cur_i]], used + 1, cur_i + 1, max_i, half);
}
int main() {
  fact[0] = 1;
  for (ll i = 1; i < 19; ++i) fact[i] = i * fact[i - 1];
  cin >> n >> k >> S;
  for (ll i = 0; i < n; ++i) cin >> a[i];
  rec(0, 0, 0, n / 2, 0);
  rec(0, 0, n / 2, n, 1);
  ll ans = 0;
  for (ll i = 0; i <= k; ++i) {
    for (const auto& p : num_ways[0][i]) {
      for (ll j = 0; j <= k - i; ++j) {
        if (num_ways[1][j].count(S - p.first))
          ans += num_ways[1][j][S - p.first] * p.second;
      }
    }
  }
  cout << ans << endl;
}
