// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <atcoder/all> // g++ main.cpp -std=c++17 -I .
using namespace std;
// using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(), (v).end()
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}
using ll=long long;

const int inf = INT_MAX / 2; const ll INF = 1LL << 60;
const ll MOD = 1000000007;
// const int MOD = 998244353;

// cout << fixed << setprecision(15) << ans << endl;
// using mint = modint1000000007;

////////////////////////////////////////////////////////////////////////////////////////////


int main() {
  int n;cin>>n;
  vector<ll> a(n);
  for(auto&i:a)cin>>i;
  sort(all(a));
  double x = a[n/2]*0.5;
  double ans = 0;
  rep(i, n) ans += x + a[i] - min((double)a[i], 2*x);
  // cout << ans << endl;
  cout << fixed << setprecision(15) << ans / n << endl;
  
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,n) for(ll i=0;i<n;i++)
#define loopn(i,j,n) for(ll i=j;i<n;i++)
#define m_arr(arr, n) vector<ll>arr(n)
#define m_arre(arr) vector<ll>arr
#define m_set(sat) set<ll>sat
#define ppn(name) pair<ll,ll>name
#define pp pair<ll,ll>
#define sort_all(arr) sort(arr.begin(), arr.end())
#define pi 3.141592653589793238
#define mod 1000000007
#define inf 1000000000000000000

ll gcd(ll a, ll b){if(a==0)return b;if(b==0)return a;return gcd(b%a, a);}

ll power(ll a, ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b%2!=0)
            res = (res*1ll*a)%mod;
        b/=2;
        a=(a*1ll*a)%mod;
    }

    return res%mod;
}
vector<bool>arr(100000);
void sieve()
{
    for(ll i=2;i<100000;i++)
    {
        if(!arr[i])
        {
            ll temp=i+i;
            while(temp<100000)
            {
                arr[temp]=true;
                temp+=i;
            }
        }
    }
}


void solve()
{
    ll n;
    cin>>n;

    m_arr(arr, n);
    loop(i, n)cin>>arr[i];

    map<ll, ll>mp;
    loop(i, n)
    {
        mp[arr[i]%200]++;
    }

    ll res=0;
    for(auto it=mp.begin();it!=mp.end();it++)
    {
        res+=(it->second*1ll*(it->second-1))/2;
    }

    cout<<res<<endl;
    return;



}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //ll t;cin>>t;while(t--)
    solve();
    return 0;
}
