#include <bits/stdc++.h>
using namespace std;
int N, K;
long long S;
long long in[(25)];
long long fac[(19) + 5];
void solve(int at, int to, long long cur_sum, int chose,
           map<long long, long long> m[]) {
  if (cur_sum > S) return;
  if (chose > K) return;
  if (at == to) {
    m[chose][cur_sum]++;
  } else {
    solve(at + 1, to, cur_sum, chose, m);
    solve(at + 1, to, cur_sum + in[at], chose, m);
    if (in[at] <= (19)) {
      solve(at + 1, to, cur_sum + fac[in[at]], chose + 1, m);
    }
  }
}
int main() {
  cin >> N >> K >> S;
  fac[0] = 1;
  for (int i = 1; i <= (19); i++) fac[i] = fac[i - 1] * i;
  for (int(i) = 0; (i) < (N); ++(i)) {
    cin >> in[i];
  }
  if (N == 1) {
    int temp = 0;
    if (in[0] == S) temp++;
    if (in[0] <= (19) && K && fac[in[0]] == S) temp++;
    cout << temp << endl;
    return 0;
  }
  map<long long, long long> m1[26], m2[26];
  solve(0, N / 2, 0, 0, m1);
  solve(N / 2, N, 0, 0, m2);
  for (int i = 0; i < K; i++) {
    for (auto it = m2[i].begin(); it != m2[i].end(); it++) {
      m2[i + 1][it->first] += it->second;
    }
  }
  long long ans = 0;
  for (int i = 0; i <= K; i++) {
    for (auto it = m1[i].begin(); it != m1[i].end(); it++) {
      ans += it->second * m2[K - i][S - it->first];
    }
  }
  cout << ans << endl;
  return 0;
}
