#include <bits/stdc++.h>
using namespace std;
const int maxn = 30;
int n, k;
long long s, ans, a[maxn], fac[maxn];
map<long long, long long> mp[maxn];
void dfs1(int x, int usd, long long now) {
  if (x == n / 2 + 1) {
    if (mp[usd].find(now) == mp[usd].end())
      mp[usd].insert(make_pair(now, 1));
    else
      mp[usd][now]++;
    return;
  }
  dfs1(x + 1, usd, now);
  if (now + a[x] <= s) dfs1(x + 1, usd, now + a[x]);
  if (fac[x] && usd < k && fac[x] + now <= s)
    dfs1(x + 1, usd + 1, fac[x] + now);
}
void dfs2(int x, int usd, long long now) {
  if (x == n + 1) {
    for (register int i = 0; i <= k - usd; i++)
      if (mp[i].find(s - now) != mp[i].end()) ans += mp[i][s - now];
    return;
  }
  dfs2(x + 1, usd, now);
  if (now + a[x] <= s) dfs2(x + 1, usd, now + a[x]);
  if (fac[x] && usd < k && fac[x] + now <= s)
    dfs2(x + 1, usd + 1, fac[x] + now);
}
int main() {
  int i, j;
  scanf("%d%d%lld", &n, &k, &s);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    fac[i] = 1;
    for (j = 1; j <= a[i]; j++) {
      fac[i] = 1ll * fac[i] * j;
      if (fac[i] > s) {
        fac[i] = 0;
        break;
      }
    }
  }
  dfs1(1, 0, 0);
  dfs2(n / 2 + 1, 0, 0);
  printf("%lld\n", ans);
  return 0;
}
