#include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long s;
long long a[30];
long long nima[30];
void dfs(int pos, int end, int t, long long sum,
         map<pair<long long, int>, int> &ft) {
  if (t > k) return;
  if (sum > s) return;
  if (pos >= end) {
    ft[make_pair(sum, t)]++;
    return;
  }
  dfs(pos + 1, end, t, sum, ft);
  dfs(pos + 1, end, t, sum + a[pos], ft);
  if (a[pos] < 26 && nima[a[pos]] > 0)
    dfs(pos + 1, end, t + 1, sum + nima[a[pos]], ft);
}
void solve() {
  memset(nima, 0, sizeof(nima));
  nima[0] = 1;
  for (int i = 1; i < 26; ++i) {
    if (nima[i - 1] * i <= s) nima[i] = nima[i - 1] * i;
  }
  map<pair<long long, int>, int> ft1, ft2;
  dfs(0, n / 2, 0, 0, ft1);
  dfs(n / 2, n, 0, 0, ft2);
  long long ans = 0;
  for (map<pair<long long, int>, int>::iterator iter = ft1.begin();
       iter != ft1.end(); ++iter) {
    long long sum = iter->first.first;
    int tk = iter->first.second;
    long long num = iter->second;
    for (int i = 0; i + tk <= k; ++i) {
      map<pair<long long, int>, int>::iterator iter2 =
          ft2.find(make_pair(s - sum, i));
      if (iter2 != ft2.end()) {
        ans += num * iter2->second;
      }
    }
  }
  cout << ans << endl;
}
int main() {
  while (cin >> n >> k >> s) {
    for (int i = 0; i < n; ++i) cin >> a[i];
    solve();
  }
}
