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.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;

import static java.lang.Math.*;

public class Solution implements Runnable {
	
    void solve() throws Exception {
    	int n = sc.nextInt();
    	int k = sc.nextInt();
    	long S = sc.nextLong();
    	int a[] = new int[n];
    	long f[] = new long[n];
    	for (int i = 0; i < n; i++) {
    		a[i] = sc.nextInt();
    	}
    	Arrays.sort(a);
    	for (int i = 0; i < n; i++) {
    		if (a[i] <= 18) {
    			f[i] = 1;
    			for (int j = 2; j <= a[i]; j++) {
    				f[i] = f[i] * j;
    			}
    		} else {
    			f[i] = 0;
    		}
    	}
    	HashMap<Long, Integer>[] cnt = new HashMap[k + 1];
    	for (int i = 0; i < k + 1; i++) {
    		cnt[i] = new HashMap<Long, Integer>();
    	}
    	int m = n / 2;
    	for (int mask = 0; mask < (1 << m); mask++) {
    		long sum = 0;
    		for (int i = 0; i < m; i++) {
    			sum += a[i] * ((mask >> i) & 1);
    		}
    		if (sum <= S) {
	    		if (cnt[0].containsKey(sum)) {
	    			cnt[0].put(sum, cnt[0].get(sum) + 1);
	    		} else {
	    			cnt[0].put(sum, 1);
	    		}
    		}
    		for (int subMask = mask; subMask > 0; subMask = (subMask - 1) & mask) {
    			sum = 0;
    			int cntK = 0;
    			for (int i = 0; i < m; i++) {
    				if ((mask & (1 << i)) != 0) {
    					if ((subMask & (1 << i)) != 0) {
    						cntK++;
    						if (f[i] == 0) {
    							sum = S + 1;
    							break;
    						} else {
    							sum += f[i];
    						}
    					} else {
    						sum += a[i];
    					}
    					if (sum > S) {
    						break;
    					}
    				}
    			}
    			if (sum <= S && cntK <= k) {
    				cnt[cntK].put(sum, cnt[cntK].containsKey(sum) ? cnt[cntK].get(sum) + 1 : 1);
    			}
    		}
    	}
    	long ans = 0;
    	for (int mask = 0; mask < (1 << (n - m)); mask++) {
    		long sum = 0;
    		for (int i = m; i < n; i++) {
    			sum += a[i] * ((mask >> (i - m)) & 1);
    		}
    		if (sum <= S) {
    			for (int j = 0; j <= k; j++) {
    				ans += (cnt[j].containsKey(S - sum) ? cnt[j].get(S - sum) : 0);
    			}
    		}
    		for (int subMask = mask; subMask > 0; subMask = (subMask - 1) & mask) {
    			sum = 0;
    			int cntK = 0;
    			for (int i = m; i < n; i++) {
    				if ((mask & (1 << (i - m))) != 0) {
    					if ((subMask & (1 << (i - m))) != 0) {
    						if (f[i] == 0) {
    							sum = S + 1;
    						} else {
    							sum += f[i];
    						}
    						cntK++;
    					} else {
    						sum += a[i];
    					}
    					if (sum > S) {
    						break;
    					}
    				}
    			}
    			if (sum <= S && cntK <= k) {
	    			for (int j = 0; j <= k - cntK; j++) {
	    				ans += (cnt[j].containsKey(S - sum) ? cnt[j].get(S - sum) : 0);
	    			}
    			}
    		}
    	}
    	out.println(ans);
    }
    
    BufferedReader in;
    PrintWriter out;
    FastScanner sc;
    
    static Throwable throwable;
    
    public static void main(String[] args) throws Throwable {
        Thread thread = new Thread(null, new Solution(), "", (1 << 26));
        thread.start();
        thread.join();
        thread.run();
        if (throwable != null)
            throw throwable;
    }
    
    
    public void run() {
        try {
            //in = new BufferedReader(new FileReader(".in"));
            //out = new PrintWriter(new FileWriter(".out"));
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            sc = new FastScanner(in);
            solve();
        } catch (Exception e) {
            throwable = e;
        } finally {
            out.close();
        }
    }
}

class FastScanner {
    BufferedReader reader;
    StringTokenizer strTok;
    
    FastScanner(BufferedReader reader) {
        this.reader = reader;
    }
    
    public String nextToken() throws Exception {
        while (strTok == null || !strTok.hasMoreTokens())
            strTok = new StringTokenizer(reader.readLine());
        return strTok.nextToken();
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}