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.util.HashMap;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Map;

public class AnyaAndCubes {
    public static void main(String[] args) {
        FasterScanner sc = new FasterScanner();
        
        int N = sc.nextInt();
        int K = sc.nextInt();
        long S = sc.nextLong();
        
        int[] balls = sc.nextIntArray(N);
        long[] facs = new long[N];
        for (int i = 0; i < N; i++) {
        	if (balls[i] <= 18) {
        		facs[i] = factorial(balls[i]);
        	}
        }
        
        int[] half1 = Arrays.copyOfRange(balls, 0, N / 2);
        int[] half2 = Arrays.copyOfRange(balls, N / 2, N);
        
        CountMap[] maps1 = compute(half1);
        CountMap[] maps2 = compute(half2);
        
        long sum = 0;
        for (int i = 0; i < maps1.length; i++) {
        	for (int j = 0; j < maps2.length && i + j <= K; j++) {
        		for (Map.Entry<Long, Long> kvp : maps1[i].entrySet()) {
            		long k = kvp.getKey();
            		long v = kvp.getValue();
            		long target = S - k;
            		sum += v * maps2[j].getValue(target);
        		}
        	}
        }
        System.out.println(sum);
        
//        System.out.println(Arrays.toString(facs));
        
//        CountMap[] maps = new CountMap[N + 2];
//        for (int i = 0; i <= N + 1; i++) {
//        	maps[i] = new CountMap();
//        }
//        maps[0].put(0L, 1L);
//        
////        CountMap map = new CountMap();
////        map.put(0L, 1L);
//        for (int i = 0; i < N; i++) {
//        	CountMap[] adds = new CountMap[i + 2];
//        	for (int j = 0; j <= i + 1; j++) {
//        		adds[j] = new CountMap();
//        	}
//        	for (int j = 0; j <= i; j++) {
//            	for (Map.Entry<Long, Long> kvp : maps[j].entrySet()) {
//            		long k = kvp.getKey();
//            		long v = kvp.getValue();
//            		adds[j].addValue(k + balls[i], v);
//            	}
//        	}
//        	if (facs[i] > 0) {
//        		for (int j = 0; j <= i; j++) {
//                	for (Map.Entry<Long, Long> kvp : maps[j].entrySet()) {
//                		long k = kvp.getKey();
//                		long v = kvp.getValue();
//                		adds[j + 1].addValue(k + facs[i], v);
//                	}
//        		}
//        	}
//        	for (int j = 0; j <= i + 1; j++) {
//        		maps[j].mergeAdd(adds[j]);
//        	}
////        	CountMap tmp = new CountMap();
////        	for (Map.Entry<Long, Long> kvp : map.entrySet()) {
////        		long k = kvp.getKey();
////        		long v = kvp.getValue();
////        		tmp.addValue(k + balls[i], v);
////        		if (facs[i] > 0) {
////        			tmp.addValue(k + facs[i], v);
////        		}
////        	}
////        	map.mergeAdd(tmp);
//        	System.out.println("DONE: " + i);
//        }
//        
//        long sum = 0;
//        for (int i = 0; i <= K; i++) {
//        	sum += maps[i].getValue(S);
//        }
//        System.out.println(sum);
    }
    
    public static CountMap[] compute(int[] balls) {
    	int N = balls.length;
    	
        long[] facs = new long[N];
        for (int i = 0; i < N; i++) {
        	if (balls[i] <= 18) {
        		facs[i] = factorial(balls[i]);
        	}
        }
        
        CountMap[] maps = new CountMap[N + 2];
        for (int i = 0; i <= N + 1; i++) {
        	maps[i] = new CountMap();
        }
        maps[0].put(0L, 1L);
        
//        CountMap map = new CountMap();
//        map.put(0L, 1L);
        for (int i = 0; i < N; i++) {
        	CountMap[] adds = new CountMap[i + 2];
        	for (int j = 0; j <= i + 1; j++) {
        		adds[j] = new CountMap();
        	}
        	for (int j = 0; j <= i; j++) {
            	for (Map.Entry<Long, Long> kvp : maps[j].entrySet()) {
            		long k = kvp.getKey();
            		long v = kvp.getValue();
            		adds[j].addValue(k + balls[i], v);
            	}
        	}
        	if (facs[i] > 0) {
        		for (int j = 0; j <= i; j++) {
                	for (Map.Entry<Long, Long> kvp : maps[j].entrySet()) {
                		long k = kvp.getKey();
                		long v = kvp.getValue();
                		adds[j + 1].addValue(k + facs[i], v);
                	}
        		}
        	}
        	for (int j = 0; j <= i + 1; j++) {
        		maps[j].mergeAdd(adds[j]);
        	}
//        	CountMap tmp = new CountMap();
//        	for (Map.Entry<Long, Long> kvp : map.entrySet()) {
//        		long k = kvp.getKey();
//        		long v = kvp.getValue();
//        		tmp.addValue(k + balls[i], v);
//        		if (facs[i] > 0) {
//        			tmp.addValue(k + facs[i], v);
//        		}
//        	}
//        	map.mergeAdd(tmp);
//        	System.out.println("DONE: " + i);
        }
        return maps;
    }
    
    public static class CountMap extends HashMap<Long, Long> {
		private static final long serialVersionUID = 4877655852387731653L;

		public long getValue(long k) {
    		return this.containsKey(k) ? this.get(k) : 0;
    	}
		
		public void addValue(long k, long v) {
			this.put(k, this.getValue(k) + v);
		}
		
		public void mergeAdd(CountMap cm) {
        	for (Map.Entry<Long, Long> kvp : cm.entrySet()) {
        		long k = kvp.getKey();
        		long v = kvp.getValue();
        		this.addValue(k, v);
        	}
		}
    }
    
    public static long factorial(int n) {
    	long p = 1;
    	for (int i = 2; i <= n; i++) {
    		p *= i;
    	}
    	return p;
    }
    
	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

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

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

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

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	        
	    public int[] nextIntArray(int n) {
	        int[] arr = new int[n];
	        for (int i = 0; i < n; i++) {
	            arr[i] = nextInt();
	        }
	        return arr;
	    }
        
		public long[] nextLongArray(int n) {
		    long[] arr = new long[n];
		    for (int i = 0; i < n; i++) {
		        arr[i] = nextLong();
		    }
		    return arr;
		}

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

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