/*
    author:ujwalll
*/
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define nx cout << "\n";
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
#define pp pair<ll, ll>
#define ppi pair<int, int>
typedef long long int ll;
#define pri(x) printf("%d ", x);
#define prl(x) printf("%lld ", x);
#define fi first;
#define se second;
#define pb push_back;
#define all(v) v.begin(), v.end()
#define minimum 1
#define maximum 1e5 
#define random minimum + (rand() % static_cast<int>(maximum - minimum + 1))

bool isPowerOfTwo(ll x){
    return x && (!(x & (x - 1)));
}
void fastio(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}
long long binpow(long long a, long long b){
    long long res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
// Pascal triangle
ll ncr(int n, int r) {
    if (n < 0 || r < 0 || r > n)
        return 0;

    ll ans = 1;
    for (int i = 1; i <= r; i++) {
        ans *= (n + 1 - i);
        ans /= i;
    }

    return ans;
}
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};
////////////////////////////////////////////////////////////////////
map<ll,set<ll>> mp;
vector<ll> adj[200005];
vector<bool> vis(200005,0);
set<ll> st;
void dfs(int s){
    st.insert(s);
    vis[s]=1;
    for(auto i:adj[s]){
        if(!vis[i])dfs(i);
    }
}
void test_case(){
    int n;
    cin>>n;
    ll a[n];
    rep(i,n)cin>>a[i];
    rep(i,n/2){
        if(a[i]!=a[n-i-1]){
            if(!mp[a[i]].count(a[n-i-1])){
                adj[a[i]].push_back(a[n-i-1]);
                adj[a[n-i-1]].push_back(a[i]);
            }
            mp[a[i]].insert(a[n-i-1]);
            mp[a[n-i-1]].insert(a[i]);
        }
    }
    ll ans = 0;
    for(int i=1;i<=200000;i++){
        if(!adj[i].size() || vis[i])continue;
        // cout<<i<<"\n";
        ll val = 0;
        st.clear();
        dfs(i);
        ans+=st.size()-1;
    }
    cout<<ans;
}
int main(){
    fastio();
    int tc = 1;
    // cin>>tc;
    while(tc--){
        test_case();
        done:;
    }
    return 0;
}
#include <iostream>
#include <cstring>
#include <string>
#include <queue>
#include <algorithm>

using namespace std;
using ll = long long;

int l;

ll dp[201][201];

ll memo(int idx, int leng);

int main()
{
    memset(dp, -1, sizeof dp);
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> l;
    cout << memo(0, 0);
}

ll memo(int idx, int leng)
{
    if (idx == 11)
    {
        if (leng < l)
            return 1;
        else
            return 0;
    }

    ll &ret = dp[idx][leng];

    if (ret != -1)
        return ret;
    ret = 0;

    for (int i = leng + 1; i < l; ++i)
        ret += memo(idx + 1, i);

    return ret;
}