#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &&i : v) scanf("%d", &i);
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        int l = i, r = i;
        while(l > 0 && v[l-1] >= v[i]) l--;
        while(r < n && v[r] >= v[i]) r++;
        ans = max(ans, (r-l)*v[i]);
    }
    cout << ans << "\n";
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define INF_ll 1000000000000000007
#define ll long long
#define endl "\n"
#define uint unsigned long long 
#define unmp unordered_map
#define unst unordered_set
#define int long long 
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << endl
#define line cout << " " << endl

/////////////////////////////////////////////////////
void hi(){
    static int i=0;
    cout << "Check Point : " << ++i << endl;
    return;
}
/////////////////////////////////////////////////////

/////////////////////////////////////////////////////
int stoi1(string str){
    int n=str.length();
    int number = 0;
    int pos = 1;
    for(int i=n-1;i>=0;i--){
        number = number + (str[i]-'0')*pos;
        pos=pos*10;
    }
    return number;
}

int power(int a,int n){
    int res = 1;
    while(n>0){
        if(n%2!=0){
            res = res*a;
            n--;
        }
        else if(n%2==0){
            a = a*a;
            n=n/2;
        }
    }
    return res;
}
/////////////////////////////////////////////////////

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //#endif
    
    int t;
    t=1;
    //cin >> t;
    while(t--){
        int k;
        cin >> k;
        int pdt;
        int count=0;
        for(int i=1;i<=k;i++){
            for(int j=1;j<=k;j++){
                if(i*j>k) break;
                for(int l=1;l<=k;l++){
                    pdt = i*j*l;
                    if(pdt<=k) count++;
                    else break;
                }
            }
        }
        cout << count << endl;
        

    }
    return 0;
    
}
