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 <typename T, typename S>
inline bool REMIN(T &a, const S &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T, typename S>
inline bool REMAX(T &a, const S &b) {
  return a < b ? a = b, 1 : 0;
}
int toint(const string &s) {
  stringstream ss;
  ss << s;
  int x;
  ss >> x;
  return x;
}
string tostring(int number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
int bit(long long x, int pos) { return ((1ll << pos) & x) ? 1 : 0; }
const int INF = 1e9;
const int NMAX = 1e5 + 5;
const long long MOD = 1000000007;
const long double PI = 2 * acos(0);
long long power(long long base, long long exp, long long c = MOD) {
  if (!exp) return 1;
  long long r = power(base, exp / 2, c);
  r = (r * r) % c;
  if (exp & 1) r = (r * base) % c;
  return r;
}
int T, N, M;
long long a, b, c;
string s1, s2;
long long S;
void nope(int dec = 0) {
  if (!dec) cout << "NO";
  exit(0);
}
long long facs[2000];
map<long long, long long> ways[30];
map<long long, long long> ways2[30];
auto temp = ways;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M >> S;
  facs[0] = 1;
  int ma = 0;
  for (int(i) = int(1); (i) <= int(1999); ++(i)) {
    facs[i] = facs[i - 1] * i;
    if (facs[i] > 1e16) break;
    ma = i;
  }
  ways[0][0] = 1;
  ways2[0][0] = 1;
  for (int(i) = int(1); (i) <= int(N / 2); ++(i)) {
    cin >> a;
    if (a > S) continue;
    for (int(k) = int(M); (k) >= int(0); --(k)) {
      auto temp = ways[k];
      for (auto pa : ways[k]) {
        if (a <= ma && k < M)
          if (pa.first + facs[a] <= S)
            ways[k + 1][pa.first + facs[a]] += pa.second;
        if (pa.first + a <= S) temp[pa.first + a] += pa.second;
      }
      ways[k] = temp;
    }
  }
  for (int(i) = int(N / 2 + 1); (i) <= int(N); ++(i)) {
    cin >> a;
    if (a > S) continue;
    for (int(k) = int(M); (k) >= int(0); --(k)) {
      auto temp = ways2[k];
      for (auto pa : ways2[k]) {
        if (a <= ma && k < M)
          if (pa.first + facs[a] <= S)
            ways2[k + 1][pa.first + facs[a]] += pa.second;
        if (pa.first + a <= S) temp[pa.first + a] += pa.second;
      }
      ways2[k] = temp;
    }
  }
  long long sum = 0;
  for (int(i) = int(0); (i) <= int(M); ++(i)) {
    for (auto pa : ways[i])
      for (int(j) = int(0); (j) <= int(M - i); ++(j)) {
        sum += pa.second * ways2[j][S - pa.first];
      }
  }
  cout << sum;
  return 0;
}