#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  ll ans = -1;
  rep(i,n){
    ll res = 0;
    ll mini = a[i];
    for (int j = i; j < n; j++) {
      chmin(mini, a[j]);
      chmax(ans, mini * (j - i + 1));
    }
  }
  cout << ans << endl;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ld long double
#define int long long
#define pi pair<int,int>
#define f first
#define s second
const int nax=3005,inf=1e18;
const ld eps=1e-14;
void find(ld x,ld r,int& low,int & high)
{
    low=ceil(x-r);
    high=floor(x+r);
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    int low=0,high=0,res=0,top=0,bottom=0;
    ld a,b,r,p;
    cin>>a>>b>>r;
    r+=eps;
    find(a,r,low,high);
    //cout<<low<<' '<<high<<'\n';
    for(int i=low;i<=high;i++)
    {
        p=sqrt(pow(r,2)-pow((a-(ld)i),2));
        find(b,p,bottom,top);
        //cout<<top<<' '<<bottom<<'\n';
        res+=top-bottom+1;
    }
    cout<<res;
    return 0;
}