#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstring>
#define fi              first
#define se              second
#define mp              make_pair
#define all(x)          x.begin(), x.end()
#define For(it, x, y)	for(int it = x; it < y; it ++)
#define ios             ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define bug(str, x)     cerr << "# " << str << " : " << x << '\n'
#define here(x)         cerr << "here " << x << '\n'

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 10;
const int maxa = 2e5;
const int inf = 1e9;
int a[maxn];
bool visited[maxn];
vector<int> G[maxn];

void dfs(int v){
	visited[v] = true;
	for(int u : G[v]){
		if(!visited[u]){
			dfs(u);
		}
	}
}

int main(){
	ios;
	int n;
	cin >> n;
	For(i, 0, n){
		cin >> a[i];
	}
	For(i, 0, n / 2){
		G[a[i]].push_back(a[n - 1 - i]);
		G[a[n - 1 - i]].push_back(a[i]);
	}
	int cnt = 0;
	For(i, 1, maxa + 1){
		if(!visited[i]){
			dfs(i);
			cnt ++;
		}
	}
	cout << maxa - cnt;
}

#include <bits/stdc++.h>
 
using namespace std;

#define int long long
 
#define sz(x) (int)(x.size())
#define all(x) (x).begin(), (x).end()

const int N = 2e5 + 4;

vector<int> adj[N];
bool vis[N];
int sz = 0;

void dfs(int u) {
	if (vis[u]) return;
	++sz; vis[u] = true;
	for (auto &v : adj[u]) {
		dfs(v);
	}
}

int32_t main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	int n; cin >> n;
	int a[n];
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = 0; i < (n + 1) / 2; ++i) {
		if (a[i] != a[n - i - 1]) {
			adj[a[i]].emplace_back(a[n - i - 1]);
			adj[a[n - i - 1]].emplace_back(a[i]);
		}
	}
	int ans = 0;
	for (int i = 1; i < N; ++i) {
		if (!vis[i]) {
			sz = 0;
			dfs(i);
			ans += (sz - 1);
		}
	}
	cout << ans;
	return 0;
}
