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:
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
300IQ as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class x525E
   {
      static int K; static long S;
      static long[] fac; static int[] arr;
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));  
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         K = Integer.parseInt(st.nextToken());
         S = Long.parseLong(st.nextToken());
         arr = new int[N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         fac = new long[19];
         fac[0] = fac[1] = 1L;
         for(int i=2; i <= 18; i++)
            fac[i] = fac[i-1]*i;
         int half = N/2;
         HashMap<Long, int[]> left = solve(0, half);
         HashMap<Long, int[]> right = solve(half, N);
         long res = 0L;
         for(long key: left.keySet())
         {
            long other = S-key;
            if(right.containsKey(other))
            {
               int[] freq1 = left.get(key);
               int[] freq2 = right.get(other);
               for(int used=0; used <= K; used++)
                  for(int a=0; a <= K; a++)
                  {
                     if(used+a > K)
                        continue;
                     res += (long)freq1[used]*freq2[a];
                  }
            }
         }
         System.out.println(res);
      }
      public static HashMap<Long, int[]> solve(int leftbound, int rightbound)
      {
         ArrayList<Integer> vals = new ArrayList<Integer>();
         for(int i=leftbound; i < rightbound; i++)
            vals.add(arr[i]);
         HashMap<Long, int[]> map = new HashMap<Long, int[]>();
         for(int mask=0; mask < (1<<vals.size()); mask++)
         {
            int bc = Integer.bitCount(mask);
            ArrayList<Integer> allowed = new ArrayList<Integer>();
            for(int b=0; b < vals.size(); b++)
               if((mask&(1<<b)) > 0)
                  allowed.add(vals.get(b));
            outer:for(int submask=0; submask < (1<<bc); submask++)
            {
               if(Integer.bitCount(submask) > K)
                  continue;
               long sum = 0L;
               for(int b=0; b < bc; b++)
               {
                  if((submask&(1<<b)) > 0)
                  {
                     if(allowed.get(b) >= 19)
                        continue outer;
                     else
                        sum += fac[allowed.get(b)];
                  }
                  else
                     sum += allowed.get(b);
               }
               if(sum <= S)
               {
                  if(!map.containsKey(sum))
                     map.put(sum, new int[K+1]);
                  int[] freq = map.get(sum);
                  freq[Integer.bitCount(submask)]++;
               }
            }
         }
         return map;
      }
   }