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.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.Set;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Artem Gilmudinov
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Reader in = new Reader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    public void solve(int testNumber, Reader in, PrintWriter out) {
        int n, k;
        long s;
        n = in.ni(); k = in.ni(); s = in.nl();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = in.ni();
        }
        long sum;
        boolean isFine;
        int numOfOne, max2, v, max;
        long ans = 0;
        HashMap<Integer,  Integer> tmpMap;

        int mid = n / 2;

        long[] fact = new long[20];
        fact[0] = 1;
        for(int i = 1; i < 20; i++) {
            fact[i] = fact[i - 1] * i;
        }

        int[] half = new int[n - mid];
        for(int i = mid; i < n; i++) {
            half[i - mid] = a[i];
        }
        HashMap<Long, HashMap<Integer, Integer>> leftMap = new HashMap<>();
        max = 1 << mid;
        for(int i = 0; i < max; i++) {
            max2 = (1 << cntOfBits(i));
            for(int j = 0; j < max2; j++) {
                isFine = true;
                int cnt = cntOfBits(j);
                sum = 0;
                if(cnt > k) {
                    continue;
                }
                for(int z = 0, p = 0; z < mid; z++) {
                    if(isBit(i, z)) {
                        if(isBit(j, p)) {
                            if(a[z] >= 19 || fact[a[z]] > s) {
                                isFine = false;
                                break;
                            } else {
                                sum += fact[a[z]];
                            }
                        } else {
                            sum += a[z];
                        }
                        p++;
                    }
                }
                if(isFine && sum <= s) {
                    //out.println(i + " " + j);
                    tmpMap = leftMap.get(sum);
                    if(tmpMap == null) {
                        tmpMap = new HashMap<>();
                        tmpMap.put(cnt, 1);
                        leftMap.put(sum, tmpMap);
                    } else {
                        if(tmpMap.containsKey(cnt)) {
                            tmpMap.put(cnt, tmpMap.get(cnt) + 1);
                        } else {
                            tmpMap.put(cnt, 1);
                        }
                    }
                }
            }

        }
        //out.println(leftMap);
        int cntRight = n - mid;
        max = 1 << (cntRight);
        for(int i = 0; i < max; i++) {
            max2 = (1 << cntOfBits(i));
            for(int j = 0; j < max2; j++) {
                isFine = true;
                sum = 0;
                int cnt = cntOfBits(j);
                if(cnt > k) {
                    continue;
                }
                for(int z = 0, p = 0; z < cntRight; z++) {
                    if(isBit(i, z)) {
                        if(isBit(j, p)) {
                            if(half[z] >= 19 || fact[half[z]] > s) {
                                isFine = false;
                                break;
                            } else {
                                sum += fact[half[z]];
                            }
                        } else {
                            sum += half[z];
                        }
                        p++;
                    }
                }
                if(isFine && sum <= s) {
                    //out.println(sum);
                    tmpMap = leftMap.get(s - sum);
                    if(tmpMap != null) {
                        for(Integer key : tmpMap.keySet()) {
                            v =  tmpMap.get(key);
                            if(key + cnt <= k) {
                                ans += v;
                            }
                        }
                    }
                }
            }

        }
        out.println(ans);
    }

    public int cntOfBits(int a) {
        int res = 0;
        for(int i = 0; i < 13; i++) {
            if((a & (1 << i)) == (1 << i)) {
                res++;
            }
        }
        return res;
    }

    public boolean isBit(int a, int k) {
        return ((a & (1 << k)) == (1 << k));
    }
}

class Reader {
    private BufferedReader in;
    private StringTokenizer st = new StringTokenizer("");
    private String delim = " ";

    public Reader(InputStream in) {
        this.in = new BufferedReader(new InputStreamReader(in));
    }

    public String next() {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(rl());
        }
        return st.nextToken(delim);
    }

    public String rl() {
        try {
            return in.readLine();
        } catch(IOException e) {
            throw new RuntimeException(e);
        }
    }

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

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

}