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.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Collections;
import java.io.IOException;
import java.util.Arrays;
import java.util.TreeMap;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Random;
import java.io.BufferedReader;
import java.util.Map;
import java.io.PrintStream;
import java.util.Comparator;
import java.util.StringTokenizer;

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

class TaskE {
    Scanner in;
    PrintWriter out;

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        this.in = in;
        this.out = out;
        run();
    }

    void run() {
        int n = in.nextInt();
        int k = in.nextInt();
        long s = in.nextLong();
        int[] is = in.nextIntArray(n);
        List<Integer> ls = Arrays.asList(Algo.box(is));
        Collections.shuffle(ls);
        is = Algo.unBox(ls.toArray(new Integer[0]));
        long[] fs = new long[n];
        boolean[] bs = new boolean[n];
        for (int i = 0; i < n; i++) {
            bs[i] = is[i] < 19;
            if (bs[i]) fs[i] = Num.factorial(is[i]);
        }
        long S = s + 1;
        Map<Long, Integer> cnt = new HashMap<>();
        cnt.put(0L, 1);
        int m = 13;
        if (n >= m) {
            int t = (int) Num.pow(3, m);
            outer: for (int x = 1; x < t; x++) {
                int y = x;
                long sum = 0;
                int c = 0;
                for (int i = 0; i < m; i++) {
                    int v = y % 3;
                    y /= 3;
                    if (v == 2 && !bs[i]) continue outer;
                    if (v == 1) sum += is[i];
                    else if (v == 2) {
                        sum += fs[i];
                        c++;
                    }
                    if (sum > s || c > k) continue outer;
                }
                Num.inc(cnt, c * S + sum);
            }
            for (int i = m; i < n; i++) {
                is[i - m] = is[i];
                fs[i - m] = fs[i];
                bs[i - m] = bs[i];
            }
            n -= m;
        }
        long res = 0;
        for (int i = 0; i <= k; i++) res += cnt.containsKey(i * S + s) ? cnt.get(i * S + s) : 0;
        int t = (int) Num.pow(3, n);
        outer: for (int x = 1; x < t; x++) {
            int y = x;
            long sum = 0;
            int c = 0;
            for (int i = 0; i < n; i++) {
                int v = y % 3;
                y /= 3;
                if (v == 2 && !bs[i]) continue outer;
                if (v == 1) sum += is[i];
                else if (v == 2) {
                    sum += fs[i];
                    c++;
                }
                if (sum > s || c > k) continue outer;
            }
            for (int i = 0; c + i <= k; i++) {
                res += cnt.containsKey(i * S + s - sum) ? cnt.get(i * S + s - sum) : 0;
            }
        }
        out.println(res);
    }
}

class Scanner {
    BufferedReader br;
    StringTokenizer st;

    public Scanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
        eat("");
    }

    private void eat(String s) {
        st = new StringTokenizer(s);
    }

    public String nextLine() {
        try {
            return br.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String s = nextLine();
            if (s == null)
                return false;
            eat(s);
        }
        return true;
    }

    public String next() {
        hasNext();
        return st.nextToken();
    }

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

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

    public int[] nextIntArray(int n) {
        int[] is = new int[n];
        for (int i = 0; i < n; i++) {
            is[i] = nextInt();
        }
        return is;
    }

}

class Algo {


    public static int[] unBox(Integer[] Is) {
        int n = Is.length;
        int[] is = new int[n];
        for (int i = 0; i < n; i++) {
            is[i] = Is[i];
        }
        return is;
    }

    public static Integer[] box(int[] is) {
        int n = is.length;
        Integer[] Is = new Integer[n];
        for (int i = 0; i < n; i++) {
            Is[i] = is[i];
        }
        return Is;
    }

}

class Num {

    public static long factorial(int n) {
        long res = 1;
        for (int i = 2; i <= n; i++)
            res *= i;
        return res;
    }

    public static long pow(long p, int e) {
        long res = 1;
        while (e != 0) {
            if ((e & 1L) != 0) res = res * p;
            p = p * p;
            e >>= 1;
        }
        return res;
    }

    public static <K> void inc(Map<K, Integer> map, K k) {
        if (!map.containsKey(k)) map.put(k, 1);
        else map.put(k, map.get(k) + 1);
    }

}