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.BufferedWriter;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.util.Collections;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.util.Arrays;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.Comparator;

/**
 * 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();
	}
}

class TaskE {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.readInt();
        int k = in.readInt();
        long S = in.readLong();
        long[] a = IOUtils.readLongArray(in, n);

        long[] fact = new long[100];
        fact[0] = 1;
        int numFacts = 0;
        for (int i = 1; i < fact.length; i++) {
            if (fact[i - 1] * i <= S) {
                fact[i] = fact[i - 1] * i;
                numFacts = i;
            } else {
                break;
            }
        }
        fact = Arrays.copyOf(fact, numFacts + 1);
        if (n == 1) {
            int ans = 0;
            if (S == 0) {
                ans++;
            }
            if (S == a[0]) {
                ans++;
            }
            if (a[0] < fact.length && k > 0 && fact[(int) a[0]] == S) {
                ans++;
            }
            out.printLine(ans);
            return;
        }

        int n1 = n / 2;
        int n2 = n - n1;
        long[] a1 = Arrays.copyOfRange(a, 0, n1);
        long[] a2 = Arrays.copyOfRange(a, n1, n1 + n2);
        int capacity1 = (int) Math.pow(3, n1) + 1;
        int capacity2 = (int) Math.pow(3, n2) + 1;
        List<EzLongIntPair> list1 = new ArrayList<EzLongIntPair>(capacity1);
        List<EzLongIntPair> list2 = new ArrayList<EzLongIntPair>(capacity2);
        gen(a1, list1, fact, S, k, 0L, 0, 0);
        gen(a2, list2, fact, S, k, 0L, 0, 0);

        Comparator<EzLongIntPair> cmp = new Comparator<EzLongIntPair>() {
            public int compare(EzLongIntPair o1, EzLongIntPair o2) {
                if (o1.first < o2.first) return -1;
                if (o1.first > o2.first) return 1;
                return o1.second - o2.second;
            }
        };
        Collections.sort(list1, cmp);
        Collections.sort(list2, cmp);

        int[] cntK = new int[k + 1];
        int[] sumsK = new int[k + 1];
        EzLongIntPair toFind = new EzLongIntPair(0, 0);
        long ans = 0;

        for (int i = 0; i < list1.size(); ) {
            int j = i;
            long sum1 = list1.get(i).first;
            while (j < list1.size() && list1.get(j).first == sum1) {
                j++;
            }

            Arrays.fill(cntK, 0);
            for (int z = i; z < j; z++) {
                cntK[list1.get(z).second]++;
            }
            sumsK[0] = cntK[0];
            for (int t = 1; t < cntK.length; t++) {
                sumsK[t] = sumsK[t - 1] + cntK[t];
            }

            toFind.first = S - sum1;
            toFind.second = -100500;
            int L2 = ~Collections.binarySearch(list2, toFind, cmp);
            toFind.second = 100500;
            int R2 = ~Collections.binarySearch(list2, toFind, cmp);

            for (int z = L2; z < R2; z++) {
                int k2 = list2.get(z).second;
                if (k - k2 >= 0) {
                    ans += sumsK[k - k2];
                }
            }

            i = j;
        }
        out.printLine(ans);
    }

    private void gen(long[] a, List<EzLongIntPair> list, long[] fact, long maxS, int maxK, long curS, int curK, int i) {
        if (curS > maxS || curK > maxK) {
            return;
        }
        if (i == a.length) {
            list.add(new EzLongIntPair(curS, curK));
            return;
        }
        gen(a, list, fact, maxS, maxK, curS, curK, i + 1);
        gen(a, list, fact, maxS, maxK, curS + a[i], curK, i + 1);
        if (a[i] < fact.length) {
            gen(a, list, fact, maxS, maxK, curS + fact[(int) a[i]], curK + 1, i + 1);
        }
    }
}

class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private 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);
	}
}

class OutputWriter {
	private final PrintWriter writer;

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

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

	public void printLine(long i) {
		writer.println(i);
	}

	public void printLine(int i) {
		writer.println(i);
	}
}

class IOUtils {

	public static long[] readLongArray(InputReader in, int size) {
		long[] array = new long[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readLong();
		return array;
	}

}

class EzLongIntPair {
    private static final int HASHCODE_INITIAL_VALUE = 0x811c9dc5;
    private static final int HASHCODE_MULTIPLIER = 0x01000193;

    public long first;
    public int second;

    public EzLongIntPair(long first, int second) {
        this.first = first;
        this.second = second;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EzLongIntPair that = (EzLongIntPair) o;

        return first == that.first && second == that.second;
    }

    public int hashCode() {
        int hash = HASHCODE_INITIAL_VALUE;
        hash = (hash ^ PrimitiveHashCalculator.getHash(first)) * HASHCODE_MULTIPLIER;
        hash = (hash ^ PrimitiveHashCalculator.getHash(second)) * HASHCODE_MULTIPLIER;
        return hash;
    }

    public String toString() {
        return "(" + first + ", " + second + ")";
    }
}

class PrimitiveHashCalculator {

	public static int getHash(int x) {
        return x;
    }

    public static int getHash(long x) {
        return (int)x ^ (int)(x >>> 32);
    }

}

