#include<bits/stdc++.h>
using namespace std;
int n,k,m;
const int N=25;
int a[N],vis[N];
int ans;
void dfs(int u,int sum){
if(u==k+1){
if(sum==m){
ans++;
}
return;
}
for(int i=1;i<=n;i++){
if(vis[i]==0){
vis[i]=1;
dfs(u+1,sum+a[i]);
vis[i]=0;
}
}
}
int main(){
freopen("c.in","r",stdin);
freopen("c.out","w",stdout);
scanf("%d %d %d",&n,&k,&m);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
}
dfs(1,0);
printf("%d\n",ans);
return 0;
}