#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 30;
long long F[MAXN], A[MAXN], Ans, S;
map<pair<long long, long long>, long long> M;
long long X;
long long n, K;
void Dfs(long long d, long long Sum, long long k) {
  if (Sum > S) return;
  if (d == X + 1) {
    M[make_pair(Sum, k)]++;
    return;
  }
  Dfs(d + 1, Sum, k);
  Dfs(d + 1, Sum + A[d], k);
  if (A[d] <= 18) Dfs(d + 1, Sum + F[A[d]], k + 1);
}
void Solve(long long d, long long Sum, long long k) {
  if (Sum < 0) return;
  if (d == n + 1) {
    for (long long Lk = 0; Lk <= K - k; Lk++)
      if (M.count(make_pair(Sum, Lk))) Ans += M[make_pair(Sum, Lk)];
    return;
  }
  Solve(d + 1, Sum, k);
  Solve(d + 1, Sum - A[d], k);
  if (A[d] <= 18) Solve(d + 1, Sum - F[A[d]], k + 1);
}
int main() {
  F[0] = 1;
  for (long long i = 1; i <= 18; i++) F[i] = F[i - 1] * i;
  cin >> n >> K >> S;
  X = n / 2;
  for (long long i = 1; i <= n; i++) cin >> A[i];
  Dfs(1, 0, 0);
  Solve(X + 1, S, 0);
  cout << Ans;
  return 0;
}
