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;
struct Node {
  long long val;
  long long cnt_k;
};
long long factorial[18 + 1];
long long n, k, S;
vector<long long> all_data, vec[2];
map<long long, map<long long, long long> > process_data[2];
bool cmp(const struct Node &n1, const struct Node &n2) {
  if (n1.val == n2.val) return n1.cnt_k < n2.cnt_k;
  return n1.val < n2.val;
}
void init() {
  factorial[0] = factorial[1] = 1;
  for (int i = 2; i < 18 + 1; i++) {
    factorial[i] = factorial[i - 1] * i;
  }
  all_data.clear();
  for (int i = 0; i < (2); i++) {
    vec[i].clear();
    process_data[i].clear();
  }
}
void next(vector<int> &_loc) {
  int len = _loc.size() - 1;
  _loc[len]++;
  while (1) {
    if (_loc[len] == 3) {
      _loc[len] = 0;
      len--;
      if (len < 0)
        break;
      else
        _loc[len]++;
    } else
      break;
  }
}
void solve(vector<long long> &_vec,
           map<long long, map<long long, long long> > &_process_vec) {
  long long dp[30][3];
  for (int i = 0; i < (_vec.size()); i++) {
    dp[i][0] = 0;
    dp[i][1] = _vec[i];
    if (_vec[i] > 18)
      dp[i][2] = -1;
    else
      dp[i][2] = factorial[_vec[i]];
  }
  vector<int> loc;
  for (int i = 0; i < (_vec.size()); i++) loc.push_back(0);
  long end = 1;
  for (int i = 0; i < (_vec.size()); i++) end *= 3;
  struct Node tmp_node;
  for (long long i = 0; i < end; i++) {
    long long cnt_k = 0;
    long long tmp_sum = 0;
    for (long long j = 0; j < loc.size(); j++) {
      if (loc[j] == 2) {
        cnt_k++;
        if (dp[j][2] == -1) {
          tmp_sum = -1;
          break;
        } else {
          tmp_sum += dp[j][2];
        }
      } else {
        tmp_sum += dp[j][loc[j]];
      }
      if (tmp_sum > S) {
        tmp_sum = -1;
        break;
      }
    }
    if (tmp_sum != -1) {
      tmp_node.val = tmp_sum;
      tmp_node.cnt_k = cnt_k;
      if (_process_vec.find(tmp_node.val) == _process_vec.end()) {
        map<long long, long long> tmp_map;
        tmp_map.insert(pair<long long, long long>(tmp_node.cnt_k, 1));
        _process_vec.insert(
            pair<long long, map<long long, long long> >(tmp_node.val, tmp_map));
      } else {
        if (_process_vec[tmp_node.val].find(cnt_k) ==
            _process_vec[tmp_node.val].end()) {
          _process_vec[tmp_node.val].insert(
              pair<long long, long long>(tmp_node.cnt_k, 1));
        } else {
          _process_vec[tmp_node.val][tmp_node.cnt_k]++;
        }
      }
    }
    next(loc);
  }
}
void fun() {
  int tmp;
  cin >> tmp;
  int dp[3];
  dp[0] = 0;
  dp[1] = tmp;
  if (tmp > 18)
    dp[2] = -1;
  else
    dp[2] = factorial[tmp];
  long long ans = 0;
  for (int i = 0; i < (3); i++)
    if (S == dp[i]) {
      ans++;
    }
  cout << ans << endl;
  return;
}
int main() {
  while (cin >> n >> k >> S) {
    init();
    if (n == 1) {
      fun();
      continue;
    }
    long long ans_sum = 0;
    long long tmp;
    for (int i = 0; i < (n); i++) {
      cin >> tmp;
      all_data.push_back(tmp);
    }
    sort(all_data.begin(), all_data.end());
    int half_size = all_data.size() / 2;
    for (int i = 0; i < (half_size); i++) vec[0].push_back(all_data[i]);
    for (int i = half_size; i <= (all_data.size() - 1); i++)
      vec[1].push_back(all_data[i]);
    solve(vec[0], process_data[0]);
    solve(vec[1], process_data[1]);
    for (auto it = process_data[0].begin(); it != process_data[0].end(); it++) {
      long long key = S - it->first;
      auto that = process_data[1].find(key);
      if (that != process_data[1].end()) {
        for (auto it1 = (it->second).begin(); it1 != (it->second).end();
             it1++) {
          for (auto it2 = (that->second).begin(); it2 != (that->second).end();
               it2++) {
            if (it1->first + it2->first <= k) {
              ans_sum += it1->second * it2->second;
            }
          }
        }
      }
    }
    cout << ans_sum << endl;
  }
  return 0;
}