#if _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#ifndef ONLINE_JUDGE 
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif

// Reads a 1D vector
template <class T>
void read1d(vector<T> & arg) {
	const int l = arg.size();
	for (int i = 0; i < l; ++i) cin >> arg[i];
}

void read() {}
// Reads arbitrary values
template <class T1, class... T2>
void read(T1& var1, T2&... var2) { cin >> var1; read(var2...); }



void pln() { cout << (DEBUG ? "]\n" : "\n"); }
template <class T1, class... T2>
void pln(const T1& var1, const T2& ... var2) { cout << var1 << " "; pln(var2...); }

// Prints arbitrary values and goes to next line
template <class T1, class... T2>
constexpr void print(const T1& var1, const T2& ... var2) { cout << (DEBUG ? " [ " : ""); pln(var1, var2...); }

// Prints arbitrary values and goes to next line ONLY IF IN DEBUG MODE
template <class T1, class... T2>
constexpr void debug(const T1& var1, const T2& ... var2) { if (!DEBUG) return;  cout << " debug : [ "; pln(var1, var2...); }





using ll = long long;
using ull = unsigned long long;
using ld = long double;


#define all(x) begin(x), end(x)

const bool MULTIPLE_TEST_CASES = 0;

ll ans = 0;
int h, w, a, b;

unordered_set<string> coll;

void calc(string& grid, int a) {
	if (a == 0) { 
		++ans; 
		if (!coll.count(grid))
			coll.insert(grid);
		return; 
	}

	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			if (grid[i * w + j] != '.') continue;

			// try HH
			if (j < w - 1 && grid[i * w + j + 1] == '.') {
				grid[i * w + j] = grid[i * w + j + 1] = 'H';
				calc(grid, a - 1);
				grid[i * w + j] = grid[i * w + j + 1] = '.';
			}
			
			// try VV
			if (i < h - 1 && grid[(i + 1) * w + j] == '.') {
				grid[i * w + j] = grid[(i + 1) * w + j] = 'V';
				calc(grid, a - 1);
				grid[i * w + j] = grid[(i + 1) * w + j] = '.';
			}
		}
	}
}
//void calc(vector<vector<char>>& grid, int a) {
//	if (a == 0) { 
//		++ans; 
//		string hash;
//		for (int i = 0; i < h; ++i) {
//			for (char c : grid[i]) hash.push_back(c);
//			//cout << endl;
//		}
//		//cout << endl;
//		coll.insert(hash);
//		return; 
//	}
//
//	for (int i = 0; i < h; ++i) {
//		for (int j = 0; j < w; ++j) {
//			if (grid[i][j] != '.') continue;
//
//			// try HH
//			if (j < w - 1 && grid[i][j + 1] == '.') {
//				grid[i][j] = grid[i][j + 1] = 'H';
//				calc(grid, a - 1);
//				grid[i][j] = grid[i][j + 1] = '.';
//			}
//			
//			// try VV
//			if (i < h - 1 && grid[i + 1][j] == '.') {
//				grid[i][j] = grid[i+1][j] = 'V';
//				calc(grid, a - 1);
//				grid[i][j] = grid[i+1][j] = '.';
//			}
//		}
//	}
//}

void exec() 
{
	read(h, w, a, b);

	//vector<vector<char>> taken(h, vector<char>(w, '.'));
	string taken(16, '.');

	calc(taken, a);

	print(coll.size());
}

















int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	if (!MULTIPLE_TEST_CASES)
		exec();
	else {
		int n;
		cin >> n;

		while (n--) exec();
	}

    return 0;
}
// Created by Kshitij Anand NSIT
#include <bits/stdc++.h>
#include <ext/numeric>
using namespace __gnu_cxx;


using namespace std;


#define int long long
#define pb push_back
#define P pair<int,int>
#define F first
#define S second
#define vi vector<int>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define mp(a, b) make_pair(a, b)
#define min3(a, b, c) min(min(a, b), c)
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max3(a, b, c) max(max(a, b), c)
#define max4(a, b, c, d) max(max(a, b), max(c, d))
#define fill(arr,val) memset(arr,val,sizeof(arr))
#define inf 1e18
#define ps(x,y) fixed<<setprecision(y)<<x
#define db(x)  cout<<#x<<" : "<<x<<endl
#define filler(arr, n)          \
    for (int i = 0; i < n; i++) \
        cin >> arr[i];
#define filler2(arr, n , m)          \
    for (int i = 0; i < n; i++) \
        for(int j=0; j<m; j++)  \
            cin >> arr[i][j];        


const int N = 1000000007;

// int n;

int X[2000005] = {};
int Y[2000005] = {};

void calc(int arr[] , int n , int x[] , int c){


    for(int i=0; i<power(2 , n); i++) {
        int sum = 0;

        for(int j=0; j<n; j++) {

            if((1<<j)&i){

                sum += arr[j + c];
            }
        }

        x[i] = sum;
    }


}

void solve(){

    int n ,a,b,c,t ,  ans=0, count=0, sum=0;
    cin>>n>>t;
    int arr[n];
    filler(arr , n);  

    calc(arr , n/2, X , 0);
    calc(arr , n - n/2, Y , n/2);

    int x_size = power(2 , n/2) , y_size = power( 2, n - n/2);


    sort(Y , Y + y_size);

    for(int i=0; i<x_size; i++) {

        if(X[i] > t)continue;


        int it = lower_bound(Y , Y + y_size , t - X[i]) - Y;

        if (it == y_size  || Y[it] != (t-X[i])) 
                it--; 

            ans = max(ans , Y[it] + X[i]);
        // if(Y[it] + X[i] <= t){
        // }
    }

    cout<<ans<<endl;

}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    
  //  int t; cin>>t; while(t--)
    {     
      solve();
    }

  return 0;
}

