#include <bits/stdc++.h>
using namespace std;
long long a[33], n, nn, k, s, ans;
long long fac[33];
map<long long, long long> mp[33];
void s1(int i, int z, long long sm) {
  if (sm > s || z > k) return;
  if (i > nn) {
    mp[z][sm]++;
    return;
  }
  s1(i + 1, z, sm);
  s1(i + 1, z, sm + a[i]);
  if (a[i] < 20) s1(i + 1, z + 1, sm + fac[a[i]]);
}
void s2(int i, int z, long long sm) {
  if (sm > s || z > k) return;
  if (i > n) {
    for (int j = z; j <= k; j++) {
      ans += mp[k - j][s - sm];
    }
    return;
  }
  s2(i + 1, z, sm);
  s2(i + 1, z, sm + a[i]);
  if (a[i] < 20) s2(i + 1, z + 1, sm + fac[a[i]]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fac[0] = 1;
  for (long long i = 1; i < 20; i++) {
    fac[i] = fac[i - 1] * i;
  }
  cin >> n >> k >> s;
  for (int i = 1; i <= n; i++) cin >> a[i];
  nn = min(15ll, n - 1ll);
  s1(1, 0, 0);
  s2(nn + 1, 0, 0);
  cout << ans << endl;
  return 0;
}
