/*
                       _oo0oo_
                      o8888888o
                      88" . "88
                      (| -_- |)
                      0\  =  /0
                    ___/`---'\___
                  .' \\|     |// '.
                 / \\|||  :  |||// \
                / _||||| -:- |||||- \
               |   | \\\  -  /// |   |
               | \_|  ''\---/''  |_/ |
               \  .-\__  '-'  ___/-. /
             ___'. .'  /--.--\  `. .'___
          ."" '<  `.___\_<|>_/___.' >' "".
         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
         \  \ `_.   \_ __\ /__ _/   .-` /  /
     =====`-.____`.___ \_____/___.-`___.-'=====
                       `=---='
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Jaspreet singh  @jsar3004  codechef/codeforces/leetcode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include<bits/stdc++.h>
#define needforspeed ios_base::sync_with_stdio(false)
#define ll long long int
#define ld long double
#define ff1(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define pp pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define in insert
#define PI 3.1415926535
#define mod 1000000007
#define coutd(x) cout << fixed << setprecision(x)
#define DECIMAL(n)  std::cout << std::fixed << std::setprecision(n);
 
using namespace std;
int maxint = numeric_limits<int>::max();
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}
 bool cmp(pair<char, ll>& a, 
         pair<char, ll>& b) 
{ 
    return a.second > b.second; 
} 
long double distance1(ll x1, ll y1, ll x2, ll y2)
{
    return  sqrt(pow(x2 - x1, 2)*1.0 +
                pow(y2 - y1, 2) * 1.0);
}
 
long long binpoww(long long a, long long b, long long m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}  
long long int binpow(long long int a, long long int b) {
    long long int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll digSum(ll n)
{
    ll sum = 0;
    while(n > 0 || sum > 9)
    {
        if(n == 0)
        {
            n = sum;
            sum = 0;
        }
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
bool prime[1000001];
 void SieveOfEratosthenes(ll n)
{
    
    memset(prime, true, sizeof(prime));
    for (ll p = 2; p * p <= n; p++)
    {    
        if (prime[p] == true)
        {
            
            for (ll i = p * p; i <= n; i += p)
                prime[i] = false;
        }
    }

   
}
void solve()
{
  ll n,m;
  cin>>n>>m;
  ll ans=0;
  ff1(i,1,n+1)
  {
    ff1(j,1,m+1)
    {
         ans+=100*i +j;
    }
  }
  cout<<ans<<endl;
}
int main()
{
    needforspeed;
    ll t=1;
    //SieveOfEratosthenes(1000001);
   // cin>>t;
    while(t--)
    {
      solve();
    }
    return 0;
  }
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define lli long long int
#define llu unsigned long long int
#define pb push_back
#define rt return 0
#define endln "\n"
#define all(x) x.begin(), x.end()
#define sz(x) (lli)(x.size())
const lli MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
// cout << fixed << setprecision(0) << pi <<endl;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
//              tree_order_statistics_node_update>
//     new_data_set;
// for multiset
// typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
//              tree_order_statistics_node_update>
//     new_data_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)
 
void solve() {
    lli n, a, t;
    cin>>n>>t;
    vector<lli> v;
    for (lli i = 0; i < n; i++) {
        cin >> a;
        v.pb(a);
    }

    lli ans = 0;
    
    if(n <= 20){
        for (lli i = 0; i < pow(2, n); i++) {
            lli tmp = i, val = 0, cnt = 0;
            while(tmp > 0){
                if(tmp % 2){
                    val += v[cnt];
                }
                tmp /= 2;
                cnt++;
            }
            if(val <= t){
                ans = max(ans, val);
            }
        }
        cout<<ans<<endl;
        return;
    }

    vector<lli> store1, store2;

    for (lli i = 0; i < pow(2, 20); i++) {
        lli tmp = i, val = 0, cnt = 0;
        while(tmp > 0){
            if(tmp % 2){
                val += v[cnt];
            }
            tmp /= 2;
            cnt++;
        }
        if(val <= t){
            store1.pb(val);
        }
    }

    for (lli i = 0; i < pow(2, n - 20); i++) {
        lli tmp = i, val = 0, cnt = 20;
        while(tmp > 0){
            if(tmp % 2){
                val += v[cnt];
            }
            tmp /= 2;
            cnt++;
        }
        if(val <= t){
            store2.pb(val);
        }
    }

    sort(all(store2));

    for (lli i = 0; i < sz(store1); i++) {
        lli val = store1[i];
        auto it = upper_bound(store2.begin(), store2.end(), t - val);
        lli ind = it - store2.begin();
        ind--;
        if(it == store2.end()){
            ind = sz(store2) - 1;
        }
        if(ind >= 0){
            val += store2[ind];
        }
        ans = max(ans, val);
    }

    cout<<ans<<endl;
}
 
int main(void) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    // lli t; cin >> t; while(t--)
    solve();
    rt;
}