#include <bits/stdc++.h>
using namespace std;
long long n, m, s, ans, a[30], fact[30];
map<long long, vector<long long> > mep;
void generate(long long pos, long long left, long long sum) {
  if (left < 0) return;
  if (sum > s) return;
  if (pos == (n + 1) / 2) {
    if (mep.find(sum) == mep.end()) {
      vector<long long> v;
      v.push_back(m - left);
      mep[sum] = v;
    } else
      mep[sum].push_back(m - left);
    return;
  }
  generate(pos + 1, left, sum);
  generate(pos + 1, left, sum + a[pos]);
  if (a[pos] <= 20) generate(pos + 1, left - 1, sum + fact[a[pos]]);
}
void solve(long long pos, long long left, long long sum) {
  if (left < 0) return;
  if (sum > s) return;
  if (pos == n) {
    if (mep.find(s - sum) != mep.end()) {
      ans += upper_bound(mep[s - sum].begin(), mep[s - sum].end(), left) -
             mep[s - sum].begin();
    }
    return;
  }
  solve(pos + 1, left, sum);
  solve(pos + 1, left, sum + a[pos]);
  if (a[pos] <= 20) solve(pos + 1, left - 1, sum + fact[a[pos]]);
}
int main() {
  fact[0] = 1;
  for (long long i = 1; i <= 20; i++) {
    fact[i] = fact[i - 1] * i;
  }
  scanf("%lld %lld %lld", &n, &m, &s);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  generate(0, m, 0);
  for (map<long long, vector<long long> >::iterator it = mep.begin();
       it != mep.end(); it++) {
    sort((*it).second.begin(), (*it).second.end());
  }
  solve((n + 1) / 2, m, 0);
  cout << ans << endl;
  return 0;
}
