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.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * 
 * @author pttrung
 */
public class E_Round_297_Div2 {

	public static long MOD = 1000000007;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		int k = in.nextInt();
		long s = in.nextLong();
		int[] data = new int[n];
		for (int i = 0; i < n; i++) {
			data[i] = in.nextInt();
		}
		long[] fac = new long[19];
		fac[0] = 1;
		for (int i = 1; i < 19; i++) {
			fac[i] = fac[i - 1] * i;
		}
		long[] a = new long[n / 2];
		long[] b = new long[n - (n / 2)];
		for (int i = 0; i < n / 2; i++) {
			a[i] = data[i];
		}
		for (int i = n / 2; i < n; i++) {
			b[i - (n / 2)] = data[i];
		}
		HashMap<Long, Long>[] map = new HashMap[k + 1];
		for (int i = 0; i <= k; i++) {
			map[i] = new HashMap();
		}
		HashMap<Long, Long>[] map1 = new HashMap[k + 1];
		for (int i = 0; i <= k; i++) {
			map1[i] = new HashMap();
		}
		for (int i = 0; i < (1 << a.length); i++) {
			for (int j = 0; j < (1 << a.length); j++) {
				if (Integer.bitCount(j) <= k && (i & j) == j) {
					long tmp = 0;
					for (int h = 0; h < a.length; h++) {
						if (((1 << h) & j) != 0) {
							if (a[h] <= 18) {
								tmp += fac[(int) a[h]];
							} else {
								tmp = -1;
								break;
							}
						}
					}
					if (tmp != -1) {
						for (int h = 0; h < a.length; h++) {
							if (((1 << h) & i) != 0 && ((1 << h) & j) == 0) {
								tmp += a[h];
							}
						}
					}
					if (tmp <= s) {
						if (!map[Integer.bitCount(j)].containsKey(tmp)) {
							map[Integer.bitCount(j)].put(tmp, 0L);
						}
						map[Integer.bitCount(j)].put(tmp,
								map[Integer.bitCount(j)].get(tmp) + 1);
					}
				}
			}
		}
		for (int i = 0; i < (1 << b.length); i++) {
			for (int j = 0; j < (1 << b.length); j++) {
				if (Integer.bitCount(j) <= k && (i & j) == j) {
					long tmp = 0;
					for (int h = 0; h < b.length; h++) {
						if (((1 << h) & j) != 0) {
							if (b[h] <= 18) {
								tmp += fac[(int) b[h]];
							} else {
								tmp = -1;
								break;
							}
						}
					}
					if (tmp != -1) {
						for (int h = 0; h < b.length; h++) {
							if (((1 << h) & i) != 0 && ((1 << h) & j) == 0) {
								tmp += b[h];
							}
						}
					}
					if (tmp <= s) {
						if (!map1[Integer.bitCount(j)].containsKey(tmp)) {
							map1[Integer.bitCount(j)].put(tmp, 0L);
						}
						map1[Integer.bitCount(j)].put(tmp,
								map1[Integer.bitCount(j)].get(tmp) + 1);
					}
				}
			}
		}
		long result = 0;
		for (int i = 0; i <= k; i++) {
			for (int j = 0; i + j <= k; j++) {
				for (long key : map[i].keySet()) {
					if (map1[j].containsKey(s - key))
						result += map[i].get(key) * map1[j].get(s - key);
				}
			}
		}
		out.println(result);
		out.close();
	}

	public static class State {
		int left;
		long cur;

		public State(int left, long cur) {

			this.left = left;
			this.cur = cur;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + (int) (cur ^ (cur >>> 32));

			result = prime * result + left;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			State other = (State) obj;
			if (cur != other.cur)
				return false;

			if (left != other.left)
				return false;
			return true;
		}

	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

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

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

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

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}