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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main{
	
	public static void main(String[] args) throws IOException
	{
		new Main().run();
	}
	
	long S;
	int K;
	long[] fact;

	public void run() throws IOException
	{
		BufferedReader file = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(file.readLine());
		int N = Integer.parseInt(st.nextToken());
		K = Integer.parseInt(st.nextToken());
		S = Long.parseLong(st.nextToken());
		int[] left = new int[N/2];
		int[] right = new int[N - left.length];
		st = new StringTokenizer(file.readLine());
		for(int i = 0;i<left.length;i++)
		{
			left[i] = Integer.parseInt(st.nextToken());
		}
		for(int i = 0;i<right.length;i++)
		{
			right[i] = Integer.parseInt(st.nextToken());
		}
		fact = new long[19];
		fact[0] = 1;
		for(int i = 1;i<fact.length;i++)
			fact[i] = fact[i-1]*i;
		ArrayList<state> a = new ArrayList<>();
		ArrayList<state> b = new ArrayList<>();
		permute(left, 0, 0, 0, a);
		permute(right, 0, 0, 0, b);
		Collections.sort(b);
		long ans = 0;
		for(state s: a)
		{
			long sum = s.sum;
			int num = s.num;
			long remaining = S - sum;
			int maxNum = K - num;
			int L = left(remaining, maxNum, b);
			int R = right(remaining, maxNum, b);
			if(R != -1)
			{
				ans += R - L + 1;
			}
		}
		System.out.println(ans);
	}
	
	//find leftmost sum smaller than num
	public int left(long sum, int num, ArrayList<state> list)
	{
		int L = -1;
		int R = list.size();
		int M = (L+R)/2;
		int smallestOcc = Integer.MAX_VALUE;
		while(R-L>1)
		{
			M = (L+R)/2;
			state s = list.get(M);
			if(s.sum > sum)
			{
				R =M;
			}else if(s.sum < sum)
			{
				L = M;
			}else if(s.num > num){
				R = M;
			}else{
				//sum is equal, num is less
				R = M;
				smallestOcc = Math.min(smallestOcc, M);
			}
		}
		return smallestOcc;
	}
	
	public int right(long sum, int num, ArrayList<state> list)
	{
		int L = -1;
		int R = list.size();
		int M = (L+R)/2;
		int largestOcc = -1;
		while(R-L>1)
		{
			M = (L+R)/2;
			state s = list.get(M);
			if(s.sum > sum)
			{
				R =M;
			}else if(s.sum < sum)
			{
				L = M;
			}else if(s.num > num){
				R = M;
			}else{
				//sum is equal, num is less
				L = M;
				largestOcc = Math.max(largestOcc, M);
			}
		}
		return largestOcc;
	}
	
	public void permute(int[] ints, long sum, int num, int index, ArrayList<state> list)
	{
		if(sum > S || num > K)
			return;
		if(index == ints.length)
		{
			list.add(new state(sum, num));
		}
		else{
			permute(ints, sum, num, index+1, list);
			permute(ints, sum+ints[index], num, index+1, list);
			if(ints[index] <= 18)
				permute(ints, sum+fact[ints[index]], num+1, index +1, list);
		}
	}
	
	private class state implements Comparable<state>{
		long sum;
		int num;
		public state(long s, int n)
		{
			sum = s;
			num = n;
		}

		@Override
		public int compareTo(state o) {
			int comp = Long.compare(sum, o.sum);
			if(comp == 0)
			{
				return Integer.compare(num, o.num);
			}
			return comp;
		}
		
		public String toString()
		{
			return sum+" "+num;
		}
		
	}
}