#include <bits/stdc++.h>
using namespace std;
const int MAXN = 26;
map<long long, long long> mp[MAXN];
int a[MAXN];
long long f[MAXN];
int n, k, m;
long long s;
long long ans;
void dfs1(int cur, int num, long long sum) {
  if (cur == m + 1) {
    for (int i = (num); i <= (k); ++i) ++mp[i][sum];
    return;
  }
  dfs1(cur + 1, num, sum);
  if (sum + a[cur] <= s) dfs1(cur + 1, num, sum + a[cur]);
  if (a[cur] <= 18 && num + 1 <= k) dfs1(cur + 1, num + 1, sum + f[a[cur]]);
}
void dfs2(int cur, int num, long long sum) {
  if (cur == n + 1) {
    ans += mp[k - num][s - sum];
    return;
  }
  dfs2(cur + 1, num, sum);
  if (sum + a[cur] <= s) dfs2(cur + 1, num, sum + a[cur]);
  if (a[cur] <= 18 && num + 1 <= k) dfs2(cur + 1, num + 1, sum + f[a[cur]]);
}
void solve() {
  ans = 0;
  for (int i = (0); i < (MAXN); ++i) mp[i].clear();
  m = n / 2;
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]);
  dfs1(1, 0, 0);
  dfs2(m + 1, 0, 0);
  printf("%I64d\n", ans);
}
int main() {
  f[0] = 1;
  for (int i = (1); i < (MAXN); ++i) f[i] = f[i - 1] * i;
  while (~scanf("%d%d%I64d", &n, &k, &s)) solve();
  return 0;
}
