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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Collections;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int k = in.readInt();
            long S = in.readLong();
            long[] factorials;
            {
                ArrayList<Long> factorial = new ArrayList<>(Collections.singleton(1L));
                while (factorial.get(factorial.size() - 1) <= S) {
                    factorial.add(factorial.size() * factorial.get(factorial.size() - 1));
                }
                factorials = new long[factorial.size()];
                for (int i = 0; i < factorials.length; i++) {
                    factorials[i] = factorial.get(i);
                }
            }
            int[] a = IOUtils.readIntArray(in, n);
            Arrays.sort(a);
            int[] leftStored = Arrays.copyOfRange(a, 0, n / 2);
            int[] right = Arrays.copyOfRange(a, n / 2, a.length);
            long res = 0;
            HashMap<Long, ArrayList<Integer>> treeMap = new HashMap<>();
            {
                int limit = (int) IntegerUtils.power(3, leftStored.length);
                for (int originalMask = 0; originalMask < limit; originalMask++) {
                    int mask = originalMask;
                    long sum = 0;
                    boolean ok = true;
                    int twosUsed = 0;
                    for (int i = 0; i < n; i++) {
                        int last = mask % 3;
                        if (last == 0) {
                            // we do not add the element
                        } else if (last == 1) {
                            sum += leftStored[i];
                        } else if (last == 2) {
                            if (leftStored[i] < factorials.length && factorials[leftStored[i]] <= S) {
                                sum += factorials[leftStored[i]];
                            } else {
                                ok = false;
                            }
                            twosUsed++;
                        }
                        mask /= 3;
                    }
                    if (ok && sum <= S && twosUsed <= k) {
                        if (!treeMap.containsKey(sum)) {
                            treeMap.put(sum, new ArrayList<>());
                        }
                        treeMap.get(sum).add(twosUsed);
                    }
                }
                for (ArrayList<Integer> al : treeMap.values()) {
                    Collections.sort(al);
                }
            }
            int limit = (int) IntegerUtils.power(3, right.length);
            for (int originalMask = 0; originalMask < limit; originalMask++) {
                int mask = originalMask;
                long sum = 0;
                boolean ok = true;
                int twosUsed = 0;
                for (int i = 0; i < n; i++) {
                    int last = mask % 3;
                    if (last == 0) {
                        // we do not add the element
                    } else if (last == 1) {
                        sum += right[i];
                    } else if (last == 2) {
                        if (right[i] < factorials.length && factorials[right[i]] <= S) {
                            sum += factorials[right[i]];
                        } else {
                            ok = false;
                        }
                        twosUsed++;
                    }
                    mask /= 3;
                }
                if (ok && sum <= S && twosUsed <= k) {
                    long remainingWant = S - sum;
                    int atMostTwos = k - twosUsed;
                    if (treeMap.containsKey(remainingWant)) {
                        ArrayList<Integer> al = treeMap.get(remainingWant);
                        int ways = lessThanOrEqualTo(al, atMostTwos);
                        res += ways;
                    }
                }
            }
            out.printLine(res);
        }

        private int lessThanOrEqualTo(ArrayList<Integer> al, int val) {
            int low = 0, high = al.size() - 1;
            while (low < high) {
                int mid = (low + high + 1) / 2;
                if (al.get(mid) <= val) {
                    low = mid;
                } else {
                    high = mid - 1;
                }
            }
            if (al.get(low) > val) return 0;
            return low + 1;
        }
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    static class IOUtils {
        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = in.readInt();
            }
            return array;
        }
    }
    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }
    }
    static class IntegerUtils {
        public static long power(long base, long exponent) {
            if (exponent == 0) {
                return 1;
            }
            long result = power(base, exponent >> 1);
            result = result * result;
            if ((exponent & 1) != 0) {
                result = result * base;
            }
            return result;
        }
    }
}

