#include <bits/stdc++.h>
#define rep(i, f, n) for (ll i = (f); i < (ll)(n); i++)
#define repe(i, f, n) for (ll i = (f); i <= (ll)(n); i++)
using namespace std;
using ll = long long;
using pint = pair<int, int>;

template <class T>
void chmin(T& a, T b) {
  if (a > b) a = b;
}

template <class T>
void chmax(T& a, T b) {
  if (a < b) a = b;
}

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, 0, n) cin >> a[i];

  ll ans = 0;
  rep(l, 0, n) {
    int x = a[l];
    rep(r, l, n) {
      chmin(x, a[r]);
      chmax(ans, x * (r - l + 1));
    }
  }

  cout << ans << endl;

  return 0;
}

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

#define rep(i,a) for(i=0;i<=a;i++)
#define repr(i,a) for(i=a;i>=0;i--)
#define repp(i,a,b) for(i=a;i<=b;i++)
#define reppr(i,b,a) for(i=b;i>=a;i--)
#define maxarr(a,n) *max_element(a,a+n);
#define minarr(a,n) *min_element(a,a+n);
#define ll long long int
#define p(ans) cout<<ans<<endl;
#define pb push_back
#define pob pop_back
#define Groza ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
#define MOD 1000000007
#define Max 1000000000
#define pyn(flag) cout<<(flag?"YES":"NO")<<endl;
#define f first
#define s second
#define parr(a,i,n) for(i=0;i<n;i++)cout<<a[i]<<" ";
#define all(v) v.begin(),v.end()
#define in insert
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

ll poww(const ll &a, ll b, const ll &m = MOD)
{   if (b == 0)
        return 1;
    ll x = poww(a, b / 2, m);
    x = x * x % m;
    if (b & 1)
        x = x * a % m;
    return x;
}
template <class T>
inline void PRINT_ELEMENTS (const T& coll, const char* optcstr = "")
{
    typename T::const_iterator pos;

    std::cout << optcstr;
    for (pos = coll.begin(); pos != coll.end(); ++pos) {
        std::cout << *pos << ' ';
    }
    std::cout << std::endl;
}
template <class T>
inline void INSERT_ELEMENTS (T& coll, int first, int last)
{
    for (int i = first; i <= last; ++i) {
        coll.insert(coll.end(), i);
    }
}

//ll spf[1000000],sum;

/*const int N = 5005;
std::vector<int> v[N];
bool ans = false;
int vis[N];
map<ll, ll>m;
//ll cnt = 0;

void dfs(ll n, ll par, ll cnt)
{
    vis[n] = 1;
    for (auto x : v[n])
    {
        if (!vis[x])
        {
            dfs(x, n, cnt + 1);
        }
        else if (vis[x] && cnt == 3 && par != x)
        {
            ans = true;
            return;
        }
    }
}*/

/*std::vector<ll> res;
bool prime[MOD];
void seive(int n)
{
    memset(prime, true, sizeof(prime));

    for (int p = 2; p * p <= n; p++)
    {
        if (prime[p] == true)
        {
            for (int i = p * p; i <= n; i += p)
                prime[i] = false;
        }
    }
    for (int p = 2; p <= n; p++)
        if (prime[p])
            res.pb(p);
}

/*const int N = 1000007;
int fact[N];
int nCr(int n, int r){
   int x =fact[r]*fact[n-r]%MOD;
   return (fact[n]*poww( x ,MOD-2))%MOD;
}
*/

float Round(float var)
{
    float value = (int)(var * 100 + .5);
    return (float)value / 100;
}

ll sumofdigit(ll n)
{
    ll sum = 0;
    while (n > 0)
    {
        sum += 1;
        n = n / 10;
    }
    return sum;
}

/*
int lcs( string X, string Y, int m, int n )
{
    int L[m + 1][n + 1];
    int i, j;
    for (i = 0; i <= m; i++)
    {
        for (j = 0; j <= n; j++)
        {
        if (i == 0 || j == 0)
            L[i][j] = 0;

        else if (X[i - 1] == Y[j - 1])
            L[i][j] = L[i - 1][j - 1] + 1;

        else
            L[i][j] = max(L[i - 1][j], L[i][j - 1]);
        }
    }
    return L[m][n];
} */

using namespace __gnu_pbds;

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    Groza;
    ll t = 1;
    //cin >> t;
    //seive(MOD);
    while (t--)
    {
        ll n, k;
        cin >> n >> k;
        ll i = 0, sum = 0, j = 0, rem = 0;
        repp(i, 1, n)
        {
            rem = i * 100;
            repp(j, 1, k)
            {
                sum += (rem + j);
            }
        }
        p(sum);
    }
    return 0;
}