#include<bits/stdc++.h>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0);
#define pb                push_back
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define ll                long long
using namespace std ;
ll i , j , c =0 ;
const ll mxn = 2e5 ;
ll arr[mxn] ;
void solve()
{
    ll n  ; cin >> n ;
    ll k =200 ;
    for(i=0;i<n;i++){
        cin >> arr[i] ;
    }
    ll cnt =0 ;
    for ( i = 0; i < n; i++) {
        arr[i] = (arr[i] + k) % k;
    }

    ll hash[k] = { 0 };

    for (i = 0; i < n; i++) {
        hash[arr[i]]++;
    }

    for (i = 0; i < k; i++) {
        cnt += (hash[i] * (hash[i] - 1)) / 2;
    }

    cout << cnt << endl;
}

signed main(){
    FastIO ;
    int t=1 ;
  ///  cin>>t ;
    while(t--){
        solve() ;
    }
    return 0 ;
}



#include <bits/stdc++.h>

using namespace std;

int main(){

  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n;
  cin >> n;
  
  vector<int> a(n);
  for(auto &x: a) cin >> x;
  
  map<int, vector<int>> graph;
  
  for(int i=0;2*i<n;i++) {
    graph[a[i]].push_back(a[n-i-1]);
    graph[a[n-i-1]].push_back(a[i]);
  }
  
  // for(auto kv: graph){
    // cout << kv.first << '\n';
    // for(auto x: kv.second)
      // cout << x << ' ';
    // cout << '\n';
  // }
  
  set<int> visited;
  int counter = 0;
  int cc_counter = 0;
  
  function<void(int)> dfs = [&](int u){
    visited.insert(u);
    cc_counter++;
    for(auto v: graph[u])
      if(!visited.count(v))
        dfs(v);
  };

  for(auto u: graph){
    if(!visited.count(u.first)){
      cc_counter = 0;
      dfs(u.first);
      counter += cc_counter - 1;
    }
  }

  cout << counter << '\n';
    
  return 0;
}

