#include <bits/stdc++.h>
using namespace std;
long long fact[20];
int n, k;
long long S;
long long a[26];
map<long long, int> ways;
long long ans;
void solve(int pos, int ed, long long cur, int used, int flag) {
  if (pos == ed) {
    if (flag)
      ways[26 * cur + used] += 1;
    else {
      for (int i = 0; i + used <= k; ++i) {
        ans += ways[26 * (S - cur) + i];
      }
    }
  } else {
    if (a[pos] < 19 && used < k && cur + fact[a[pos]] <= S)
      solve(pos + 1, ed, cur + fact[a[pos]], used + 1, flag);
    solve(pos + 1, ed, cur, used, flag);
    if (cur + a[pos] <= S) solve(pos + 1, ed, cur + a[pos], used, flag);
  }
}
int main() {
  fact[1] = 1;
  for (int i = 2; i <= 19; ++i) {
    fact[i] = fact[i - 1] * 1LL * i;
  }
  cin >> n >> k;
  cin >> S;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  solve(0, n / 2 + 1, 0, 0, 1);
  ans = 0;
  solve(n / 2 + 1, n, 0, 0, 0);
  cout << ans;
}
