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

/**
 * @author master_j
 * @version 0.4.1
 * @since Mar 22, 2015
 */
public class Solution {
    final int MAX_FACT = 18;
    long[] facts;

    private void solve() throws IOException {
        int n = io.nI(), k = io.nI();
        long s = io.nL();
        int[] a = io.nIa(n);
        Arrays.sort(a);
        int m = n / 2;
        n -= m;
        int[] lefts = new int[n], rights = new int[m];
        for (int i = 0; i < n + m; i++)
            if (i < n)
                lefts[i] = a[i];
            else
                rights[i - n] = a[i];

        facts = new long[1 + MAX_FACT];
        facts[0] = 1L;
        for (int i = 1; i < facts.length; i++)
            facts[i] = facts[i - 1] * i;

        Map<Long, Integer>[] leftPart = partSolve(lefts, k, s);
        Map<Long, Integer>[] rightPart = partSolve(rights, k, s);
        long ans = 0L;

        for (int i = 0; i < rightPart.length; i++) {
            final int j = k - i;
            for (Long v : rightPart[i].keySet()) {
                for (int i1 = 0; i1 <= j; i1++)
                    if (leftPart[i1].containsKey(s - v))
                        ans += rightPart[i].get(v) * leftPart[i1].get(s - v);
            }
        }

        io.wln(ans);
    }//2.2250738585072012e-308


    Map<Long, Integer>[] partSolve(int[] a, int k, long s) {
        Map<Long, Integer>[] res = new HashMap[1 + k];
        for (int i = 0; i <= k; i++)
            res[i] = new HashMap<>();

        byte[] mask = new byte[a.length];
        do {
            int twos = calcTwos(mask);
            if (twos <= k) {
                long v = calc(mask, a);
                if (v <= s && v != Long.MAX_VALUE) {
                    if (!res[twos].containsKey(v))
                        res[twos].put(v, 0);
                    res[twos].put(v, 1 + res[twos].get(v));
                }
            }
            nextMask(mask);
        } while (!allZeroes(mask));

        return res;
    }

    long calc(byte[] mask, int[] a) {
        long res = 0L;
        for (int i = 0; i < a.length; i++)
            if (mask[i] == 1)
                res += a[i];
            else if (mask[i] == 2)
                if (a[i] <= MAX_FACT)
                    res += facts[a[i]];
                else
                    return Long.MAX_VALUE;
        return res;
    }

    void nextMask(byte[] mask) {
        for (int i = 0; i < mask.length; i++) {
            mask[i]++;
            if (mask[i] < 3)
                break;
            else
                mask[i] = 0;
        }
    }

    boolean allZeroes(byte[] mask) {
        for (byte b : mask)
            if (b != 0)
                return false;
        return true;
    }

    int calcTwos(byte[] mask) {
        int res = 0;
        for (byte b : mask)
            if (b == 2)
                res++;
        return res;
    }

    public static void main(String[] args) throws IOException {
        IO.launchSolution(args);
    }

    Solution(IO io) throws IOException {
        this.io = io;
        solve();
    }

    private final IO io;
}

class IO {
    static final String _localArg = "master_j";
    private static final String _problemName = "";
    private static final Mode _inMode = Mode.STD_;
    private static final Mode _outMode = Mode.STD_;
    private static final boolean _autoFlush = false;

    enum Mode {STD_, _PUT_TXT, PROBNAME_}

    private final StreamTokenizer st;
    private final BufferedReader br;
    private final Reader reader;

    private final PrintWriter pw;
    private final Writer writer;

    static void launchSolution(String[] args) throws IOException {
        boolean local = (args.length == 1 && args[0].equals(IO._localArg));
        IO io = new IO(local);

        long nanoTime = 0;
        if (local) {
            nanoTime -= System.nanoTime();
            io.wln("<output>");
        }

        io.flush();
        new Solution(io);
        io.flush();

        if (local) {
            io.wln("</output>");
            nanoTime += System.nanoTime();
            final long D9 = 1000000000, D6 = 1000000, D3 = 1000;
            if (nanoTime >= D9)
                io.wf("%d.%d seconds\n", nanoTime / D9, nanoTime % D9);
            else if (nanoTime >= D6)
                io.wf("%d.%d millis\n", nanoTime / D6, nanoTime % D6);
            else if (nanoTime >= D3)
                io.wf("%d.%d micros\n", nanoTime / D3, nanoTime % D3);
            else
                io.wf("%d nanos\n", nanoTime);
        }

        io.close();
    }

    IO(boolean local) throws IOException {
        if (_inMode == Mode.PROBNAME_ || _outMode == Mode.PROBNAME_)
            if (_problemName.length() == 0)
                throw new IllegalStateException("You imbecile. Where's my <_problemName>?");

        if (_problemName.length() > 0)
            if (_inMode != Mode.PROBNAME_ && _outMode != Mode.PROBNAME_)
                throw new IllegalStateException("You imbecile. What's the <_problemName> for?");

        Locale.setDefault(Locale.US);

        if (local) {
            reader = new FileReader("input.txt");
            writer = new OutputStreamWriter(System.out);
        } else {
            switch (_inMode) {
                case STD_:
                    reader = new InputStreamReader(System.in);
                    break;
                case PROBNAME_:
                    reader = new FileReader(_problemName + ".in");
                    break;
                case _PUT_TXT:
                    reader = new FileReader("input.txt");
                    break;
                default:
                    throw new NullPointerException("You imbecile. Gimme _inMode.");
            }
            switch (_outMode) {
                case STD_:
                    writer = new OutputStreamWriter(System.out);
                    break;
                case PROBNAME_:
                    writer = new FileWriter(_problemName + ".out");
                    break;
                case _PUT_TXT:
                    writer = new FileWriter("output.txt");
                    break;
                default:
                    throw new NullPointerException("You imbecile. Gimme _outMode.");
            }
        }

        br = new BufferedReader(reader);
        st = new StreamTokenizer(br);

        pw = new PrintWriter(writer, _autoFlush);

        if (local && _autoFlush)
            wln("Note: auto-flush is on.");
    }

    //@formatter:off
    void wln()          {pw.println(); }
    void wln(boolean x) {pw.println(x);}
    void wln(char x)    {pw.println(x);}
    void wln(char x[])  {pw.println(x);}
    void wln(double x)  {pw.println(x);}
    void wln(float x)   {pw.println(x);}
    void wln(int x)     {pw.println(x);}
    void wln(long x)    {pw.println(x);}
    void wln(Object x)  {pw.println(x);}
    void wln(String x)  {pw.println(x);}

    void wf(String f, Object... o) {pw.printf(f, o);}

    void w(boolean x)   {pw.print(x);}
    void w(char x) {pw.print(x);}
    void w(char x[]) {pw.print(x);}
    void w(double x)    {pw.print(x);}
    void w(float x)     {pw.print(x);}
    void w(int x)       {pw.print(x);}
    void w(long x)      {pw.print(x);}
    void w(Object x)    {pw.print(x);}
    void w(String x)    {pw.print(x);}

    int nI() throws IOException {st.nextToken(); return (int)st.nval;}
    double nD() throws IOException {st.nextToken(); return st.nval;}
    float nF() throws IOException {st.nextToken(); return (float)st.nval;}
    long nL() throws IOException   {st.nextToken(); return (long)st.nval;}
    String nS() throws IOException {st.nextToken(); return st.sval;}

    int[] nIa(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nI();
        return a;
    }
    double[] nDa(int n) throws IOException {
        double[] a = new double[n];
        for (int i = 0; i < n; i++)
            a[i] = nD();
        return a;
    }
    String[] nSa(int n) throws IOException {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = nS();
        return a;
    }

    void wc(String x)         {wc(x.toCharArray());}
    void wc(char c1, char c2) {for (char c = c1; c<=c2; c++) wc(c);}
    void wc(char x[])         {for (char c : x) wc(c); }
    void wc(char x)           {st.ordinaryChar(x); st.wordChars(x, x);}

    public boolean eof() {return st.ttype == StreamTokenizer.TT_EOF;}
    public boolean eol() {return st.ttype == StreamTokenizer.TT_EOL;}

    void flush() {pw.flush();}
    void close() throws IOException {reader.close(); br.close(); flush(); pw.close();}
    //@formatter:on
}
