#include <bits/stdc++.h>
long long ex[10000007];
int first[10000007], ey[10000007], ez[10000007], es[10000007];
int g[30];
long long f[30];
int i, k, l, n, sum_fact;
long long m, s;
void dfs1(int x, int y, long long z) {
  if ((y > k) || (z > m)) return;
  if (x > n / 2) {
    bool b = false;
    int r = ((k - y) * (long long)1e16 + m - z) % 10000007;
    for (int i = first[r]; i != 0; i = ez[i])
      if ((ex[i] == m - z) && (ey[i] == k - y)) {
        es[i]++;
        b = true;
        break;
      }
    if (!b) {
      sum_fact++;
      ex[sum_fact] = m - z, ey[sum_fact] = k - y, es[sum_fact] = 1;
      ez[sum_fact] = first[r], first[r] = sum_fact;
    }
    return;
  }
  dfs1(x + 1, y, z);
  dfs1(x + 1, y, z + g[x]);
  if (g[x] <= 18) dfs1(x + 1, y + 1, z + f[g[x]]);
  return;
}
void dfs2(int x, int y, long long z) {
  if ((y > k) || (z > m)) return;
  if (x > n) {
    for (int i = y; i <= k; i++)
      for (int j = first[(i * (long long)1e16 + z) % 10000007]; j != 0;
           j = ez[j])
        if ((ex[j] == z) && (ey[j] == i)) s = s + es[j];
    return;
  }
  dfs2(x + 1, y, z);
  dfs2(x + 1, y, z + g[x]);
  if (g[x] <= 18) dfs2(x + 1, y + 1, z + f[g[x]]);
  return;
}
int main() {
  scanf("%d%d%I64d", &n, &k, &m);
  for (i = 1; i <= n; i++) scanf("%d", &g[i]);
  for (i = 1; i <= n; i++)
    if (g[i] <= 18) l++;
  if (k > l) k = l;
  f[0] = 1;
  for (i = 1; i <= 18; i++) f[i] = f[i - 1] * i;
  dfs1(1, 0, 0);
  dfs2(n / 2 + 1, 0, 0);
  printf("%I64d", s);
  return 0;
}
