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.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

@SuppressWarnings("unused")
public class Solution{
	
	static final long maxS = (long)1e16+100;
	static int k;
	static long[] fact;
	
	@SuppressWarnings("unchecked")
	public static void main(String[] args) throws IOException {
		FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    	
    	int tt = 1;
    	outer:
    	while(tt-->0) {
    		
    		int n = fs.nextInt();
    		k = fs.nextInt();
    		long s = fs.nextLong();
    		
    		fact = new long[19]; fact[0] = 1;
    		for(int i=1;i<19;i++) fact[i] = fact[i-1]*i;
    		
    		HashMap<Long, Integer>[] map1 = new HashMap[k+1], map2 = new HashMap[k+1];
    		for(int i=0;i<=k;i++) {
    			map1[i] = new HashMap<>(); map2[i] = new HashMap<>();
    		}
    		
    		int[] a = fs.readArray(n);
    		Arrays.sort(a);
    		ArrayList<Integer> l1 = new ArrayList<>(), l2 = new ArrayList<>();
    		for(int i=0;i<n;i++) {
    			if(i<n/2) l1.add(a[i]);
    			else l2.add(a[i]);
    		}
    		
    		calc(l1, map1); calc(l2, map2);
    		
    		
    		HashMap<Long, Long>[] pre = new HashMap[k+1];
    		for(int i=0;i<=k;i++) pre[i] = new HashMap<Long, Long>();
    		
    		for(int i=0;i<=k;i++) {
    			if(i>0) {
    				for(long sum: pre[i-1].keySet()) pre[i].put(sum, pre[i-1].get(sum));
    			}
    			pre[i].put(0L, 1L);
    			for(long sum: map2[i].keySet()) {
    				if(sum==0) continue;
    				int x = map2[i].get(sum);
    				pre[i].put(sum, ((i>0)?(pre[i].getOrDefault(sum, 0L)):0L) + (long)map2[i].get(sum));
    			}
    		}
    		
    		map1[0].put(0L, 1);
    		
    		long ans = 0;
    		
    		for(int i=0;i<=k;i++) {
    			for(long sum: map1[i].keySet()) {
    				if(sum<=s) {
    					ans += (long)map1[i].get(sum)*(pre[k-i].getOrDefault(s-sum, 0L));
    				}
    			}
    		}
    		
    		out.println(ans);
    		
    		
    		
    		
    	}
    	
    	out.close();
    }
	
	//O(3^N)
	static void calc(ArrayList<Integer> list, HashMap<Long, Integer>[] map) {
		int n = list.size();
		for(int mask=0;mask<(1<<n);mask++) {
			ArrayList<Integer> taken = new ArrayList<>();
			for(int i=0;i<n;i++) if((mask&(1<<i))!=0) taken.add(list.get(i));
			if(taken.size()>0)
				func(taken, map, 0, 0, 0);
		}
	}
	
	static void func(ArrayList<Integer> l, HashMap<Long, Integer>[] map, int i, int curk, long sum) {
		if(curk>k || sum>maxS) return;
		if(i==l.size()) {
			map[curk].put(sum, map[curk].getOrDefault(sum, 0)+1); return;
		}
		if(l.get(i)<=18) func(l, map, i+1, curk+1, sum + fact[l.get(i)]);
		func(l, map, i+1, curk, sum + l.get(i));
	}
	

	static final Random random=new Random();
    
    static <T> void shuffle(T[] arr) {
    	int n = arr.length;
    	for(int i=0;i<n;i++	) {
    		int k = random.nextInt(n);
    		T temp = arr[k]; arr[k] = arr[i]; arr[i] = temp;
    	}
    }
    
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
    
    static void ruffleSort(long[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); long temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    static void reverse(int[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		int temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    static void reverse(long[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		long temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    
    static <T> void reverse(T[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++) {
    		T temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }


   	
}