Problem: Anya loves to fold and stick. Today she decided to do just that.

Anya has n cubes lying in a line and numbered from 1 to n from left to right, with natural numbers written on them. She also has k stickers with exclamation marks. We know that the number of stickers does not exceed the number of cubes.

Anya can stick an exclamation mark on the cube and get the factorial of the number written on the cube. For example, if a cube reads 5, then after the sticking it reads 5!, which equals 120.

You need to help Anya count how many ways there are to choose some of the cubes and stick on some of the chosen cubes at most k exclamation marks so that the sum of the numbers written on the chosen cubes after the sticking becomes equal to S. Anya can stick at most one exclamation mark on each cube. Can you do it?

Two ways are considered the same if they have the same set of chosen cubes and the same set of cubes with exclamation marks.

Input

The first line of the input contains three space-separated integers n, k and S (1 ≤ n ≤ 25, 0 ≤ k ≤ n, 1 ≤ S ≤ 1016) — the number of cubes and the number of stickers that Anya has, and the sum that she needs to get. 

The second line contains n positive integers ai (1 ≤ ai ≤ 109) — the numbers, written on the cubes. The cubes in the input are described in the order from left to right, starting from the first one. 

Multiple cubes can contain the same numbers.

Output

Output the number of ways to choose some number of cubes and stick exclamation marks on some of them so that the sum of the numbers became equal to the given number S.

Examples

Input

2 2 30
4 3


Output

1


Input

2 2 7
4 3


Output

1


Input

3 1 1
1 1 1


Output

6

Note

In the first sample the only way is to choose both cubes and stick an exclamation mark on each of them.

In the second sample the only way is to choose both cubes but don't stick an exclamation mark on any of them.

In the third sample it is possible to choose any of the cubes in three ways, and also we may choose to stick or not to stick the exclamation mark on it. So, the total number of ways is six.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline istream& operator>>(istream& fin, pair<T1, T2>& pr) {
  fin >> pr.first >> pr.second;
  return fin;
}
template <class T0, class T1, class T2>
inline istream& operator>>(istream& fin, tuple<T0, T1, T2>& t) {
  fin >> get<0>(t) >> get<1>(t) >> get<2>(t);
  return fin;
}
template <class T>
inline istream& operator>>(istream& fin, vector<T>& a) {
  if (!a.size()) {
    size_t n;
    fin >> n;
    a.resize(n);
  }
  for (auto& u : a) fin >> u;
  return fin;
}
inline int64_t factorial(const int64_t n, const long double w) {
  long double acc = 0;
  int64_t i;
  for (i = 1; i < n + 1 && acc < w; ++i) acc += ::logl((long double)i);
  if (i < n + 1) return -1;
  int64_t val = 1LL;
  for (int64_t i = 2; i < n + 1; ++i) val *= i;
  return val;
}
uint64_t e252() {
  size_t n, k;
  int64_t sum;
  cin >> n >> k >> sum;
  vector<int64_t> a(n);
  cin >> a;
  vector<int64_t> b(n);
  for (size_t i = 0; i < n; ++i)
    b[i] = factorial(a[i], ::logl((long double)(sum + 1)));
  vector<int64_t> c(n);
  for (size_t i = 1; i < n; ++i) c[i - 1] = min(max(a[i], b[i]), sum);
  partial_sum(c.rbegin(), c.rend(), c.rbegin());
  for (auto& i : c) i = min(i, sum);
  ;
  ;
  vector<map<int64_t, uint64_t> > cnt(k + 1);
  cnt[0][0] = 1;
  vector<pair<int64_t, uint64_t> > buf;
  for (size_t i = 0; i < n / 2; ++i) {
    buf.clear();
    const auto inc = sum - c[i];
    auto last = cnt[k].upper_bound(sum - a[i]);
    for (auto iter = cnt[k].lower_bound(inc - a[i]); iter != last; ++iter)
      buf.emplace_back(iter->first + a[i], iter->second);
    const auto xinc = sum - accumulate(begin(a) + i + 1, end(a), (int64_t)0);
    cnt[k].erase(begin(cnt[k]), cnt[k].lower_bound(xinc));
    for (const auto& pr : buf) cnt[k][pr.first] += pr.second;
    for (size_t j = k - 1; j < k; --j) {
      buf.clear();
      last = cnt[j].upper_bound(sum - a[i]);
      for (auto iter = cnt[j].lower_bound(inc - a[i]); iter != last; ++iter)
        buf.emplace_back(iter->first + a[i], iter->second);
      if (b[i] != -1) {
        last = cnt[j].upper_bound(sum - b[i]);
        for (auto iter = cnt[j].lower_bound(inc - b[i]); iter != last; ++iter)
          cnt[j + 1][iter->first + b[i]] += iter->second;
      }
      cnt[j].erase(begin(cnt[j]), cnt[j].lower_bound(inc));
      for (const auto& pr : buf) cnt[j][pr.first] += pr.second;
    }
  }
  vector<unordered_map<int64_t, uint64_t> > left;
  for (auto& m : cnt) left.emplace_back(begin(m), end(m)), m.clear();
  cnt[0][0] = 1;
  for (size_t i = n / 2; i < n; ++i) {
    buf.clear();
    auto last = cnt[k].upper_bound(sum - a[i]);
    for (auto iter = begin(cnt[k]); iter != last; ++iter)
      buf.emplace_back(iter->first + a[i], iter->second);
    for (const auto& pr : buf) cnt[k][pr.first] += pr.second;
    for (size_t j = k - 1; j < k; --j) {
      buf.clear();
      last = cnt[j].upper_bound(sum - a[i]);
      for (auto iter = begin(cnt[j]); iter != last; ++iter)
        buf.emplace_back(iter->first + a[i], iter->second);
      if (b[i] != -1) {
        last = cnt[j].upper_bound(sum - b[i]);
        for (auto iter = begin(cnt[j]); iter != last; ++iter)
          cnt[j + 1][iter->first + b[i]] += iter->second;
      }
      for (const auto& pr : buf) cnt[j][pr.first] += pr.second;
    }
  }
  uint64_t val = 0;
  for (size_t i = 0; i < cnt.size(); ++i)
    for (const auto& pr : cnt[i])
      for (size_t j = 0; i + j < k + 1 && j < left.size(); ++j) {
        const auto iter = left[j].find(sum - pr.first);
        if (iter != end(left[j])) val += pr.second * iter->second;
      }
  return val;
}
int main(const int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << e252();
  return EXIT_SUCCESS;
}