#include <bits/stdc++.h>
using namespace std;
int n, k, all[27];
long long s;
long long fct[20];
long long idd = 1;
long long go(int ind) {
  if (ind == 0 || ind == 1)
    return 1;
  else
    return idd * ind * go(ind - 1);
}
map<long long, long long> counter[28];
int half;
int rem;
long long ans = 0;
void go1(int pos, int kk, long long sum) {
  if (kk > k) return;
  if (sum > s) return;
  if (pos == half + 1) {
    counter[kk][sum]++;
    return;
  }
  go1(pos + 1, kk, sum);
  go1(pos + 1, kk, sum + all[pos]);
  if (all[pos] <= 18) go1(pos + 1, kk + 1, sum + fct[all[pos]]);
}
void go2(int pos, int kk, long long sum) {
  if (sum > s) return;
  if (kk > k) return;
  if (pos == n + 1) {
    int dif = k - kk;
    for (int i = 0; i <= dif; i++) {
      if (counter[i].find(s - sum) != counter[i].end()) {
        ans += counter[i][s - sum];
      }
    }
    return;
  }
  go2(pos + 1, kk, sum);
  go2(pos + 1, kk, sum + all[pos]);
  if (all[pos] <= 18) go2(pos + 1, kk + 1, sum + fct[all[pos]]);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k >> s;
  for (int i = 1; i <= n; i++) cin >> all[i];
  for (int i = 1; i < 19; i++) fct[i] = go(i);
  sort(all, all + n);
  half = n / 2;
  rem = n - half;
  go1(1, 0, 0);
  go2(half + 1, 0, 0);
  cout << ans << endl;
}
