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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

public class E {

	static InputStreamReader isr = new InputStreamReader(System.in);
	static BufferedReader br = new BufferedReader(isr);

	static long[] readIntArray() throws IOException {
		String[] v = br.readLine().split(" ");
		long[] ans = new long[v.length];

		for (int i = 0; i < ans.length; i++) {
			ans[i] = Long.valueOf(v[i]);
		}

		return ans;
	}

	static long MAX_S = 10000000000000000l;
	static HashMap<Long, Integer> counts = new HashMap<Long, Integer>();
	static List<Entry> hist = new ArrayList<Entry>();

	static List<Integer> nonFactMarks = new ArrayList<Integer>();
	static long[] facts;
	static long[] a;
	static long S;
	static int k;
	static int n;
	static long ans = 0;

	static class Entry implements Comparable<Entry> {
		public long entry;
		public int cnt;

		public Entry (long entry) {
			this.entry = entry;
			this.cnt = 1;
		}
		
		@Override
		public int compareTo(Entry arg0) {
			return -new Long(this.entry).compareTo(arg0.entry);
		}

		@Override
		public boolean equals(Object another) {
			if (another == null)
				return false;
			if (this.getClass().isInstance(another)) {
				Entry a = (Entry) another;
				return a.entry == this.entry;
			} else {
				return false;
			}
		}

		@Override
		public int hashCode() {
			return new Long(entry).hashCode();
		}
	}

	static long[] maxPossible = new long[50];
	public static void main(String[] args) throws IOException {
		long[] d = readIntArray();
		n = (int) d[0];
		k = (int) d[1];
		S = d[2];
		a = readIntArray();

		facts = new long[19];
		for (int i = 1; i < facts.length; i++) {
			facts[i] = fact(i, S);
		}

		for (int i = 0; i < a.length; i++) {
			inc(hist, a[i]);
		}
		Collections.sort(hist);
		for (int i = 0; i < hist.size(); i++) {
			maxPossible[i] = doesMakeSenseToContinue(i);
		}
		
		long t1 = System.currentTimeMillis();
		fill2(0, 0, 0, 1);
//		System.out.println(System.currentTimeMillis() - t1);
		System.out.println(ans);
	}

	private static void inc(List<Entry> hist, long l) {
		int ind = hist.indexOf(new Entry(l));
		if (ind != -1) {
			hist.get(ind).cnt++;
		} else {
			hist.add(new Entry(l));
		}
	}

	static void fill2(int pos, long cursum, int usedk, long mul) {
		if (pos == hist.size()) {
			if (cursum == S) {
				ans += mul;
			}
			return;
		}

		if (S - cursum > maxPossible[pos]) {
			return;
		}
		
		long v = hist.get(pos).entry;
		int c = hist.get(pos).cnt;

		if (v <= 18) {
			for (int i = 0; i <= c; i++) {
				for (int j = 0; j <= Math.min(i, k - usedk); j++) {
					long newsum = cursum;
					if (S - newsum >= (i - j) * v) {
						newsum += (i - j) * v;
						for (int k = 0; k < j; k++) {
							if (S - newsum >= facts[(int) v]) {
								newsum += facts[(int) v];
							} else {
								newsum = -1;
								break;
							}
						}
						if (newsum != -1)
							fill2(pos + 1, newsum, usedk + j, mul
									* choose(c, i) * choose(i, j));
						else
							break;
					}

				}
			}
		} else {
			for (int i = 0; i <= c; i++) {
				if (S - cursum >= v * i)
					fill2(pos + 1, cursum + v * i, usedk, mul * choose(c, i));
				else
					break;
			}
		}

	}

	private static long doesMakeSenseToContinue(int pos) {
		long maxPossible = 0;
		for (int i = pos; i < hist.size(); i++) {
			int c = hist.get(i).cnt;
			long v = hist.get(i).entry;
			if (v <= 18) {
				for (int j = 0; j < c; j++) {
					maxPossible += facts[(int)v];
				}
			} else {
				maxPossible += v * c;
			}
		}
		
		return maxPossible;
	}

	static long[][] chooseCache = new long[50][50];
	static boolean[][] chooseCacheContains = new boolean[50][50];

	private static long choose(int n, int k) {
		if (k == 0)
			return 1;
		if (k == 1) {
			return n;
		}
		if (k == n)
			return 1;
		if (chooseCacheContains[n][k])
			return chooseCache[n][k];
		long res = choose(n - 1, k - 1) + choose(n - 1, k);
		chooseCacheContains[n][k] = true;
		chooseCache[n][k] = res;
		return res;
	}

	private static long fact(long l, long s) {
		long f = 1;
		for (long i = l; i >= 2; i--) {
			if ((MAX_S / f) < i) {
				return -1;
			}

			f *= i;
		}

		return f;
	}
}