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 PYTHON):

Solution:
from sys import stdin, stdout
import math
from collections import defaultdict

def Comb(nn,rr):
    f = math.factorial
    return f(nn) / f(rr) / f(nn-rr)


n,k,S = [int(x) for x in stdin.readline().split()]
a = [int(x) for x in stdin.readline().split()]

aset = set(a)
alist = list(aset)
alist.sort()

plist = []
for i in alist:
	plist.append((i,a.count(i)))

oplist = []
for x,c in plist:
	tlist = []
	if x > 18:
		for i in xrange(c+1):
			tlist.append((i*x,0,Comb(c,i)))  # (amount added, stickers used, multiplier)
	else:
		xfact = math.factorial(x)
		for nf in xrange(c+1):
			for i in xrange(nf,c+1):
				tlist.append((nf*xfact+(i-nf)*x, nf, Comb(c,i)*Comb(i,nf)))
	oplist.append(tlist)

'''
print plist
for tlist in oplist:
	print tlist
	
b = list(a)
c = [False for x in a]
for i in xrange(len(b)):
	if b[i] < 19:
		b[i] = math.factorial(b[i])
		c[i] = True
'''

def rec(mult,d,l,i,f,nn,s=0):
	if i < nn:
		for add, nf, mm in oplist[i]:
			x = s + add
			ff = f + nf
			if x <= S and ff <= k:
				if add > 0:
					l.add(x)
					d[ff][x] += mult*mm
				rec(mult*mm, d, l, i+1, ff, nn, x)
				
'''
def rec(d,l,i,f,nn,s=0):
	if i < nn:
		rec(d,l,i+1,f,nn,s)
		x = s+a[i]
		if x <= S:
			rec(d,l,i+1,f,nn,x)
			l.add(x)
			d[f][x] += 1
		if c[i] and f < k:
			x = s+b[i]
			if x <= S:
				rec(d,l,i+1,f+1,nn,x)
				l.add(x)
				d[f+1][x] += 1
'''	
				
n = len(alist)
				
dl1 = [defaultdict(int) for i in xrange(k+1)]
dl1[0][0] = 1
nn = n/2
s = set()
rec(1,dl1,s,0,0,nn)
l1 = list(s)
l1.append(0)
dl2 = [defaultdict(int) for i in xrange(k+1)]
dl2[0][0] = 1
s = s = set()
rec(1,dl2,s,nn,0,n)
l2 = list(s)
l2.append(0)

count = 0
l1.sort()
l2.sort(reverse=True)
i = 0
j = 0

while i < len(l1):
	while l2[j] > S - l1[i]:
		j += 1
	if l1[i] + l2[j] == S:
		for m in xrange(k+1):
			for r in xrange(m+1):
				count += dl1[r][l1[i]] * dl2[m-r][l2[j]]
	i += 1

print count