#include<bits/stdc++.h>
using namespace std;
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define MAX             INT_MAX
#define MIN             INT_MIN
#define F               first
#define S               second
#define pbmax           priority_queue<int>//max heap
#define pbmin           priority_queue<int, vector<int>, greater<int>>//min heap priority_queue
#define lpi(i,a,b)      for(int i=0;i<b;i++)
#define lpd(i,a,b)      for(int i=a;i>=b;i--)
const double pi = 3.14159265359;
const int mod = 1e9 + 7;
const int N = 2e5 + 5;
vector<int>G[N];
vector<int>vis(N, 0);
void dfs(int node, int &dist)
{
    vis[node] = 1;
    dist++;
    for (auto x : G[node])
    {
        if (vis[x] == 0)
        {
            dfs(x, dist);
        }
    }
}
void task()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    int l = 0, r = n - 1;
    vector<pair<int, int>>vp;
    set<int>S;
    while (l < r)
    {
        if (a[l] != a[r]) {
            vp.pb({a[l], a[r]});
            S.insert(a[l]);
            S.insert(a[r]);
        }
        l++;
        r--;
    }
    if (vp.size() == 0)
    {
        cout << 0 << '\n';
        return;
    }
    for (auto x : vp)
    {
        G[x.F].pb(x.S);
        G[x.S].pb(x.F);
    }
    int ans = 0;
    for (auto x : S)
    {
        if (vis[x] == 0)
        {
            int cnt = 0;
            dfs(x, cnt);
            ans += max((int)0, cnt - 1);
        }
    }
    cout << ans << '\n';

}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int test_cases = 1;
    //cin >> test_cases;
    while (test_cases--)
    {
        task();

    }
}
#include <bits/stdc++.h>

const long long INF = 1e9;
const long long MOD = 1e9 + 7;
//const long long MOD = 998244353;
const long long LINF = 1e18;
using namespace std;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define dump(x)  cout << #x << " = " << (x) << endl
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define COUT(x) cout<<(x)<<endl
#define SCOUT(x) cout<<(x)<<" "
#define VECCOUT(x) for(auto&youso_: (x) )cout<<right<<setw(10)<<youso_<<" ";cout<<endl
#define ENDL cout<<endl
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) long long __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define mp make_pair
#define PQ priority_queue<long long>
#define PQG priority_queue<long long,V,greater<long long>>


typedef long long ll;
typedef vector<long long> vl;
typedef vector<long long> vi;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vc> vvc;
typedef pair<long long, long long> pll;


#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
template<class T>
void mod(T &x) {
    x %= MOD;
    x += MOD;
    x %= MOD;
}

ll GCD(ll a, ll b) {
    if(b == 0) return a;
    else return GCD(b, a%b);
}

struct COMB{
    vl fact, fact_inv, inv;
    void init_nCk(long long SIZE) {
        fact.resize(SIZE + 5);
        fact_inv.resize(SIZE + 5);
        inv.resize(SIZE + 5);
        fact.at(0) = fact.at(1) = fact_inv.at(0) = fact_inv.at(1) = inv.at(1) = 1;
        for(long long i = 2; i < SIZE + 5; i++) {
            fact.at(i) = fact.at(i - 1)*i%MOD;
            inv.at(i) = MOD - inv.at(MOD%i)*(MOD/i)%MOD;
            fact_inv.at(i) = fact_inv.at(i - 1)*inv.at(i)%MOD;
        }
    }
    long long nCk (long long n, long long k) {
        assert(!(n < k));
        assert(!(n < 0 || k < 0));
        return fact.at(n)*(fact_inv.at(k)*fact_inv.at(n - k)%MOD)%MOD;
    }
};
ll extGCD(ll a, ll b, ll &x, ll &y) {
    if(b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    y -= a/b*x;
    return d;
}


void Main() {
    CIN(K);
    ll res = 0;
    for(int a = 1; a*a*a <= K; a++) {
        int k = K/a;
        for(int b = a; b*b <= k; b++) {
            for(int c = b; b*c <= k; c++) {
                if(a*b*c <= K) {
                    if(a != b && b != c) {
                        res += 6;
                    } else if(a == b && b != c) {
                        res += 3;
                    } else if(a != b && b == c) {
                        res += 3;
                    } else {
                        res += 1;
                    }
                }
            }
        }
    }
    cout << res << endl;
}

int main() {
    cout << fixed << setprecision(15);
    Main();
    return 0;
}