#include <bits/stdc++.h>
using namespace std;
long long n, m, s, d[30], cnt, mid, ans;
long long bz[20];
unordered_map<long long, long long> mp[30];
void dfs(long long l, long long r, long long sum, long long sy) {
  if (sum > s || sy > m) return;
  if (l > r) {
    if (r == mid) {
      for (int i = 0; i <= m - sy; i++) {
        ans += mp[i][s - sum];
      }
    } else {
      mp[sy][sum]++;
    }
    return;
  }
  dfs(l + 1, r, sum + d[l], sy);
  dfs(l + 1, r, sum, sy);
  if (d[l] < 20) dfs(l + 1, r, sum + bz[d[l]], sy + 1);
}
int main() {
  bz[1] = 1;
  for (int i = 2; i <= 19; i++) {
    bz[i] = bz[i - 1] * i;
  }
  scanf("%lld%lld%lld", &n, &m, &s);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &d[i]);
  }
  mid = n / 2;
  dfs(mid + 1, n, 0, 0);
  dfs(1, mid, 0, 0);
  printf("%lld", ans);
}
