#include <bits/stdc++.h>
using namespace std;
const int N = 30;
long long a[N], s, fac[N], res;
int n, k, r1, r2;
unordered_map<long long, long long> mp[N];
void dfs1(int u, int tot, long long sum) {
  if (sum > s || tot > k) return;
  if (u == r1 + 1) {
    mp[tot][sum]++;
    return;
  }
  dfs1(u + 1, tot, sum);
  dfs1(u + 1, tot, sum + a[u]);
  if (a[u] <= 20 && fac[a[u]] <= s) dfs1(u + 1, tot + 1, sum + fac[a[u]]);
}
void dfs2(int u, int tot, long long sum) {
  if (sum > s || tot > k) return;
  if (u == r2 + 1) {
    for (int i = 0; i <= k - tot; i++) res += mp[i][s - sum];
    return;
  }
  dfs2(u + 1, tot, sum);
  dfs2(u + 1, tot, sum + a[u + r1]);
  if (a[u + r1] <= 20 && fac[a[u + r1]] <= s)
    dfs2(u + 1, tot + 1, sum + fac[a[u + r1]]);
}
int main() {
  scanf("%d%d%lld", &n, &k, &s);
  r1 = n >> 1;
  r2 = n - r1;
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long Max = 1;
  fac[0] = 1;
  for (int i = 1; i <= 20; i++) fac[i] = fac[i - 1] * i;
  dfs1(1, 0, 0);
  dfs2(1, 0, 0);
  printf("%lld\n", res);
  return 0;
}
