#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const double eps = 1e-15;
long long fac[20];
map<long long, long long> mp[30];
long long num[30];
int n, k;
long long ans, s;
void dfs_1(int i, int cnt, long long sum) {
  if (sum > s) return;
  if (i == n / 2) {
    ++mp[cnt][sum];
    return;
  }
  dfs_1(i + 1, cnt, sum);
  dfs_1(i + 1, cnt, sum + num[i]);
  if (num[i] <= 18 && cnt < k) {
    dfs_1(i + 1, cnt + 1, sum + fac[num[i]]);
  }
}
void dfs_2(int i, int cnt, long long sum) {
  if (sum > s) return;
  if (i == n) {
    for (int j = 0; j + cnt <= k; ++j)
      if (mp[j].count(s - sum)) ans += mp[j][s - sum];
    return;
  }
  dfs_2(i + 1, cnt, sum);
  dfs_2(i + 1, cnt, sum + num[i]);
  if (num[i] <= 18 && cnt < k) dfs_2(i + 1, cnt + 1, sum + fac[num[i]]);
}
int main() {
  fac[0] = 1;
  for (int i = 1; i <= 18; ++i) fac[i] = fac[i - 1] * i;
  scanf("%d%d%lld", &n, &k, &s);
  for (int i = 0; i < n; ++i) scanf("%lld", &num[i]);
  dfs_1(0, 0, 0);
  ans = 0;
  dfs_2(n / 2, 0, 0);
  printf("%I64d\n", ans);
  return 0;
}
