#include "bits/stdc++.h"

using namespace std;
using namespace std::chrono;

using ll = long long;
using str = string;
using db = double;

#define tcT template <class T
#define tcTU tcT, class U

tcT> using V = vector<T>;
tcT> using VV = V<V<T>>;
tcTU> using PR = pair<T, U>;
tcT> using PQ = priority_queue<T>;

#define pf push_front
#define pb push_back
#define ef emplace_front
#define eb emplace_back

#define rsz resize
#define ist insert
#define ers erase
#define cnt count

#define ppf pop_front()
#define ppb pop_back()
#define ft front()
#define bk back()
#define bg begin()
#define ed end()
#define ety empty()
#define fs first
#define sd second

#define brk break
#define ctn continue
#define rtn return

#define sz(v) int((v).size())
#define all(v) (v).bg, (v).ed
#define srt(v) sort(all(v))
#define rev(v) reverse(all(v))
#define unq(v) unique(all(v))

#define ice(i, a, b) for (auto (i) = (a); (i) < (b); ++(i))
#define fire(i, a, b) for (auto (i) = (b) - 1; (i) >= (a); --(i))
#define dark(a, v) for (auto& (a) : (v))

const int MOD[] = {int(1e9 + 7), 998244353};
const ll MAX[] = {200005, (ll)1e18};

const int DX[] = {+1, 0, -1, 0, +1, -1, -1, +1};
const int DY[] = {0, +1, 0, -1, +1, +1, -1, -1};
// D --> R --> U --> L --> DR --> UR --> UL --> DL

constexpr int pct(int a) { rtn __builtin_popcount(a); }
constexpr int bts(int a) { rtn (a ? 31 - __builtin_clz(a) : 0); }
constexpr int mx2(int a) { rtn bts(a); }
constexpr int mn2(int a) { rtn bts(a) + ((a & (a - 1)) > 0); }

constexpr ll pct(ll a) { rtn __builtin_popcountll(a); }
constexpr ll bts(ll a) { rtn (a ? 63 - __builtin_clzll(a) : 0); }
constexpr ll mx2(ll a) { rtn bts(a); }
constexpr ll mn2(ll a) { rtn bts(a) + ((a & (a - 1)) > 0); }
constexpr ll pw2(ll a) { rtn 1LL << a; }

tcT> bool setMin(T& a, const T& b) { rtn (a > b ? a = b, 1 : 0); }
tcT> bool setMax(T& a, const T& b) { rtn (a < b ? a = b, 1 : 0); }

tcT> T fDiv(const T& a, const T& b) { rtn a / b - ((a ^ b) < 0 && (a % b)); }
tcT> T cDiv(const T& a, const T& b) { rtn a / b + ((a ^ b) > 0 && (a % b)); }

tcT> int lwb(const V<T>& v, const T& a) { rtn int(lower_bound(all(v), a) - v.bg); }
tcT> int upb(const V<T>& v, const T& a) { rtn int(upper_bound(all(v), a) - v.bg); }

tcTU> T binSearch(T a, const T& jump, const U& f) { for (T x = jump; x; x /= 2) while (f(a + x)) a += x; rtn a; }

tcT> void squish(V<T>& v) { v.ers(unq(v), v.ed); }

void space(int sp) { if (sp) cout << ' '; }
void line(int ln) { if (ln) cout << '\n'; }
tcT> void show(T var, int gd = 0, int sp = 1, int ln = 0) { cout << var; space(sp); line(ln);}
tcTU> void show(PR<T, U> p, int gd = 0, int sp = 1, int ln = 0) { cout << '{' << p.fs << ", " << p.sd << '}'; space(sp); line(ln); }
tcT> void show(V<T> v, int gd = 0, int sp = 1, int ln = 0) { dark(a, v) show(a, 0, sp, ln); line(1 - gd); }

VV<int> adj(200005);
V<bool> vis(200005);
int num;

void dfs(int cur) {
  if (vis[cur]) {
    rtn;
  }
  vis[cur] = true;
  ++num;
  dark (nxt, adj[cur]) {
    dfs(nxt);
  }
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(17);
  ofstream outfile;
  outfile.open("../test_output.txt");
  int tc = 1;
  // cin >> tc;
  ice (test, 1, tc + 1) {
    int n;
    cin >> n;
    // ^
    auto hajime = high_resolution_clock::now();
    /* */
    V<int> v(n);
    dark (a, v) {
      cin >> a;
    }
    ice (i, 0, n / 2) {
      if (v[i] != v[(n - 1) - i]) {
        adj[v[i]].pb(v[(n - 1) - i]);
        adj[v[(n - 1) - i]].pb(v[i]);
      }
    }
    int ans = 0;
    ice (i, 0, 200005) {
      if (!vis[i]) {
        num = 0;
        dfs(i);
        ans += (num - 1);
      }
    }
    cout << ans;
    // ^
    auto finish = high_resolution_clock::now();
    auto duration = duration_cast<milliseconds>(finish - hajime);
    outfile << "test " << test << ": " << duration.cnt() << " ms\n";
  }
  outfile.close();
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long

int exchange(int i,map<int,int> &dic){
  if(dic.find(i) == dic.end()) return i;
  else {
    dic[i] = exchange(dic[i],dic);
    return dic[i];
  }
}

template <typename T,typename S> void print_map(map<T,S> &a){
  for(auto& i:a){
    cout << i.first << " * " << i.second << endl;
  }
}  

int main(){

  int n;
  cin >> n;
  vector<int> a(n);
  for(auto& i : a) cin >> i;
  
  map<int,int> dic;

  int ans =0;
  for(int i=0; i<n/2; ++i) {
    if(exchange(a[i],dic)==exchange(a[n-i-1],dic)) continue;
    else{
      ans ++;
      dic[exchange(a[i],dic)] = exchange(a[n-1-i],dic);
    }
    //print_map(dic);
    //cout << "--------------" << endl;
  }

  cout << ans << endl;
  

  

}
