#include <bits/stdc++.h>
using namespace std;
long long n, k, s;
long long a[30];
long long fac[30];
queue<long long> Q[30];
map<long long, long long> M[30];
void DFS1(int depth, int end, int sticks, long long v) {
  if (depth == end + 1) {
    Q[sticks].push(v);
    return;
  }
  DFS1(depth + 1, end, sticks, v);
  DFS1(depth + 1, end, sticks, v + a[depth]);
  if (a[depth] <= 19) DFS1(depth + 1, end, sticks + 1, v + fac[a[depth]]);
}
void DFS2(int depth, int end, int sticks, long long v) {
  if (depth == end + 1) {
    M[sticks][v]++;
    return;
  }
  DFS2(depth + 1, end, sticks, v);
  DFS2(depth + 1, end, sticks, v + a[depth]);
  if (a[depth] <= 19) DFS2(depth + 1, end, sticks + 1, v + fac[a[depth]]);
}
int main() {
  fac[1] = 1;
  for (int i = 2; i <= 19; i++) fac[i] = fac[i - 1] * i;
  scanf("%lld%lld%lld", &n, &k, &s);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  DFS1(1, n / 2, 0, 0);
  DFS2(n / 2 + 1, n, 0, 0);
  long long ans = 0;
  for (int i = 0; i <= k; i++) {
    while (!Q[i].empty()) {
      long long front = Q[i].front();
      Q[i].pop();
      for (int j = 0; j <= k; j++) {
        if (i + j > k) break;
        if (M[j].count(s - front) != 0) ans += M[j][s - front];
      }
    }
  }
  printf("%lld", ans);
  return 0;
}
