#include <bits/stdc++.h>
using namespace std;
map<long long, long long> A[26], B[26];
map<long long, long long>::iterator it;
long long fact[20], ans[30], aim, sum;
int n, k, mid, kind;
void dfs(int id, int f, long long s) {
  if (s > aim || f > k) return;
  if ((kind == 1 && id > mid) || (kind == 2 && id > n)) {
    if (kind == 1)
      A[f][s]++;
    else {
      for (int i = f; i <= k; ++i) B[i][s]++;
    }
    return;
  }
  dfs(id + 1, f, s);
  dfs(id + 1, f, s + ans[id]);
  if (ans[id] < 19) dfs(id + 1, f + 1, s + fact[ans[id]]);
}
int main() {
  fact[1] = 1;
  for (int i = 2; i <= 19; ++i) fact[i] = fact[i - 1] * i;
  scanf("%d %d %I64d", &n, &k, &aim);
  for (int i = 1; i <= n; ++i) scanf("%I64d", &ans[i]);
  mid = n / 2;
  kind = 1;
  dfs(1, 0, 0);
  kind = 2;
  dfs(mid + 1, 0, 0);
  for (int i = 0; i <= k; ++i) {
    for (it = A[i].begin(); it != A[i].end(); ++it) {
      sum += (*it).second * (B[k - i][aim - (*it).first]);
    }
  }
  printf("%I64d\n", sum);
  return 0;
}
