#include <bits/stdc++.h>
using namespace std;
map<pair<long long, int>, int> a, b;
long long f[25], S;
int val[25];
int _n, _k;
void dfs1(int pos, long long sum, int k) {
  if (sum > S || k > _k) return;
  if (pos > _n / 2) {
    a[pair<long long, int>(sum, k)]++;
    return;
  }
  dfs1(pos + 1, sum + val[pos], k);
  dfs1(pos + 1, sum, k);
  if (val[pos] <= 20) dfs1(pos + 1, sum + f[val[pos]], k + 1);
}
void dfs2(int pos, long long sum, int k) {
  if (sum > S || k > _k) return;
  if (pos > _n) {
    b[pair<long long, int>(sum, k)]++;
    return;
  }
  dfs2(pos + 1, sum + val[pos], k);
  dfs2(pos + 1, sum, k);
  if (val[pos] <= 20) dfs2(pos + 1, sum + f[val[pos]], k + 1);
}
void init() {
  f[0] = f[1] = 1;
  for (int i = 2; i <= (20); i++) f[i] = i * f[i - 1];
}
int main() {
  init();
  while (cin >> _n >> _k >> S) {
    a.clear();
    b.clear();
    for (int i = 1; i <= _n; ++i) cin >> val[i];
    dfs1(1, 0, 0);
    dfs2(_n / 2 + 1, 0, 0);
    long long ans = 0;
    map<pair<long long, int>, int>::iterator it = a.begin();
    for (; it != a.end(); it++) {
      int j = (*it).first.second;
      for (int i = 0; i + j <= _k; ++i) {
        if (b.count(make_pair(S - (it->first.first), i)))
          ans += (long long)it->second * b[make_pair(S - (it->first.first), i)];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
