#include <bits/stdc++.h>
using namespace std;
long long n, k, s;
long long a[30];
unordered_map<long long, long long> mp[30];
long long aim[30], ss[20], fans = 0;
void dfs(long long num, long long kk, long long sum) {
  if (sum > s) return;
  if (num == n / 2 + 1) {
    mp[kk][sum]++;
    return;
  }
  if (a[num] <= 18) {
    aim[num] = ss[a[num]];
    dfs(num + 1, kk + 1, sum + aim[num]);
  }
  aim[num] = a[num];
  dfs(num + 1, kk, sum + aim[num]);
  aim[num] = 0;
  dfs(num + 1, kk, sum + aim[num]);
}
void get(long long num, long long kk, long long sum) {
  if (sum > s) return;
  if (num == n + 1) {
    for (int i = 0; i <= k - kk; i++) fans += mp[i][s - sum];
    return;
  }
  if (a[num] <= 18) {
    aim[num] = ss[a[num]];
    get(num + 1, kk + 1, sum + aim[num]);
  }
  aim[num] = a[num];
  get(num + 1, kk, sum + aim[num]);
  aim[num] = 0;
  get(num + 1, kk, sum + aim[num]);
}
int main() {
  scanf("%lld%lld%lld", &n, &k, &s);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  ss[0] = 1;
  for (long long i = 1; i <= 18; i++) ss[i] = ss[i - 1] * i;
  dfs(1, 0, 0);
  get(n / 2 + 1, 0, 0);
  printf("%lld\n", fans);
  return 0;
}
