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.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map.Entry;

public class E297 {
	FastScanner in = new FastScanner(System.in);
	PrintWriter out = new PrintWriter(System.out);

	int n, k;
	long S;
	int[] a;
	long[] fact;
	
	int count(int origin, int id) {
		int res = 0;
		while (origin > 0) {
			if (origin % 3 == id) res++;
			origin /= 3;
		}
		return res;
	}
	
	HashMap<Long, Long>[] calc(int lower, int upper) {
		HashMap<Long, Long>[] map = new HashMap[k+1];
		for (int i = 0; i <= k; i++) {
			map[i] = new HashMap<Long, Long>();
		}
		int range = upper - lower;
		
		for (int i = 0; i < (int)Math.pow(3, range); i++) {
			int nk = count(i, 2);
			if (nk > k) continue;
			long sum = 0;
			for (int j = 0, val = i; j < range; j++, val /= 3) {
				int next = val % 3;
				if (next == 1) {
					sum += a[j+lower];
				} else if (next == 2) {
					if (a[j+lower] >= 21) {
						sum = -1;
						break;
					} else {
						sum += fact[a[j+lower]];
					}
				}
			}
			if (sum != -1) {
				if (map[nk].containsKey(sum))
					map[nk].put(sum, map[nk].get(sum) + 1L);
				else
					map[nk].put(sum, 1L);
			}
		}
		return map;
	}
	
	public void run() {
		n = in.nextInt();
		k = in.nextInt();
		S = in.nextLong();
		a = in.nextIntArray(n);
		
		fact = new long[21];
		fact[1] = 1;
		for (int i = 2; i < fact.length; i++) {
			fact[i] = fact[i-1] * i;
		}
		
		HashMap<Long, Long>[] map1 = calc(0, n / 2);
		HashMap<Long, Long>[] map2 = calc(n / 2, n);
		
		long res = 0;
		for (int i = 0; i <= k; i++) {
			for (Entry<Long, Long> e : map1[i].entrySet()) {
				for (int j = 0; j <= k - i; j++) {
					long key = S - e.getKey();
					if (map2[j].containsKey(key)) {
						res += e.getValue() * map2[j].get(key);
					}
				}
				
			}
		}
		System.out.println(res);
		
		out.close();
	}

	public static void main(String[] args) {
		new E297().run();
	}

	public void mapDebug(int[][] a) {
		System.out.println("--------map display---------");

		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.printf("%3d ", a[i][j]);
			}
			System.out.println();
		}

		System.out.println("----------------------------");
		System.out.println();
	}

	public void debug(Object... obj) {
		System.out.println(Arrays.deepToString(obj));
	}

	class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
			//stream = new FileInputStream(new File("dec.in"));

		}

		int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] nextIntArray(int n) {
			int[] array = new int[n];
			for (int i = 0; i < n; i++)
				array[i] = nextInt();

			return array;
		}

		int[][] nextIntMap(int n, int m) {
			int[][] map = new int[n][m];
			for (int i = 0; i < n; i++) {
				map[i] = in.nextIntArray(m);
			}
			return map;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		long[] nextLongArray(int n) {
			long[] array = new long[n];
			for (int i = 0; i < n; i++)
				array[i] = nextLong();

			return array;
		}

		long[][] nextLongMap(int n, int m) {
			long[][] map = new long[n][m];
			for (int i = 0; i < n; i++) {
				map[i] = in.nextLongArray(m);
			}
			return map;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		double[] nextDoubleArray(int n) {
			double[] array = new double[n];
			for (int i = 0; i < n; i++)
				array[i] = nextDouble();

			return array;
		}

		double[][] nextDoubleMap(int n, int m) {
			double[][] map = new double[n][m];
			for (int i = 0; i < n; i++) {
				map[i] = in.nextDoubleArray(m);
			}
			return map;
		}

		String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		String[] nextStringArray(int n) {
			String[] array = new String[n];
			for (int i = 0; i < n; i++)
				array[i] = next();

			return array;
		}

		String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}
}