text: /*
  "An anomaly, I'm Muhammad Ali
    Cause I know one day I'm gonna be the"
                  - Greatest, Eminem
  */
  #pragma GCC optimize ("O3")
  #pragma GCC target ("sse4")
  #include<bits/stdc++.h>
  using namespace std;
  typedef long long int ll;
  #define ff first
  #define Shazam ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL);
  #define ss second
  #define all(c) c.begin(),c.end()
  #define endl "\n"
  #define test() int t; cin>>t; while(t--)
  #define fl(i,a,b) for(int i = a ; i <b ;i++)
  #define get(a) fl(i,0,a.size())  cin>>a[i];
  #define pra(a) fl(i,0,a.size()) cout<<a[i]<<" ";	cout<<endl;
  #define pr(a,n) fl(i,0,n) cout<<a[i]<<" ";	cout<<endl;
  const ll INF = 2e18;
  const int inf = 2e9;
  const int mod1 = 1e9 + 7;
  
  
  
  int main(){
      Shazam;
      vector<vector<int>> g(2e5 + 5);
      int n; cin >> n;
      vector<int> a(n);
      get(a);
      for(int i = 0; i < n / 2; i++){
          if(a[i] != a[n - 1 - i]){
              g[a[i]].push_back(a[n - 1 - i]);
              g[a[n - 1 - i]].push_back(a[i]);
          }
      }
      vector<int> vis(2e5 + 5);
      int sz = 0;
      int ans = 0;
      function<void(int)> dfs = [&](int u){
          vis[u] = 1;
          sz++;
          for(int v : g[u]){
              if(!vis[v]) dfs(v);
          }
      };
      for(int i = 1; i < 2e5 + 5; i++){
          if(!vis[i]){
              sz = 0;
              dfs(i);
              ans += sz - 1;
          }
      }
      cout << ans << endl;
      return 0;
  }