#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[30];
long long int s, fact[30], answer = 0;
map<long long int, long long int> dp[30];
void back(int step, int n, int kk, long long int sum, bool toAdd) {
  if (step > n) {
    if (toAdd)
      dp[kk][sum]++;
    else {
      for (int i = 0; i <= k - kk; i++)
        if (dp[i].find(s - sum) != dp[i].end()) answer += dp[i][s - sum];
    }
    return;
  }
  back(step + 1, n, kk, sum, toAdd);
  if (sum + a[step] <= s) back(step + 1, n, kk, sum + a[step], toAdd);
  if (kk < k && a[step] <= 19 && sum + fact[a[step]] <= s)
    back(step + 1, n, kk + 1, sum + fact[a[step]], toAdd);
}
int main() {
  scanf("%d %d %lld", &n, &k, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  fact[0] = 1;
  for (int i = 1; i <= 19; i++) fact[i] = fact[i - 1] * i;
  back(1, n / 2, 0, 0, true);
  back(n / 2 + 1, n, 0, 0, false);
  printf("%lld", answer);
  return 0;
}
