#include <bits/stdc++.h>
using namespace std;
int n, k, mid;
long long S;
long long bit[30];
int ans = 1;
int a[30];
map<pair<int, long long>, long long> mark;
struct point {
  int x;
  long long y;
} t[1594324];
void dfs1(int x, int y, long long all) {
  if (all > S || y > k) return;
  if (x == mid + 1) {
    t[ans].x = y;
    t[ans++].y = all;
    return;
  }
  dfs1(x + 1, y, all);
  dfs1(x + 1, y, all + a[x]);
  if (a[x] <= 19) dfs1(x + 1, y + 1, all + bit[a[x]]);
}
void dfs2(int x, int y, long long all) {
  if (all > S) return;
  if (x == n + 1) {
    mark[make_pair(y, all)]++;
    return;
  }
  dfs2(x + 1, y, all);
  dfs2(x + 1, y, all + a[x]);
  if (a[x] <= 19) dfs2(x + 1, y + 1, all + bit[a[x]]);
}
int main() {
  scanf("%d%d%lld", &n, &k, &S);
  bit[0] = 1;
  for (int i = 1; i <= 19; i++) bit[i] = bit[i - 1] * i;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  mid = n / 2;
  dfs1(1, 0, 0);
  dfs2(mid + 1, 0, 0);
  long long sum = 0;
  for (int i = 1; i < ans; i++) {
    for (int j = 0; j <= k - t[i].x; j++) {
      sum += mark[make_pair(j, S - t[i].y)];
    }
  }
  printf("%lld\n", sum);
  return 0;
}
