#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;
}
