#include <bits/stdc++.h>

using namespace std;

#define endl "\n"
#define fo(i,s,e) for( i=s;i<e;i++)
#define rfo(i,s,e) for(i=s;i>e;i--)
#define ll long long int
#define pb push_back
#define pob pop_back()
#define sp " "
#define ff first
#define ss second
const ll MOD=1e9+7;
const ll INF = (1LL << 60) - 1;

ll power(ll x, ll y){
	if (y == 0)
		return 1;
	ll temp = power(x, y / 2);
	if (y % 2 == 0)
		return temp * temp;
	else
		return (x * temp) * temp;
}

int main(){
	int t;
	cin>>t;
	ll count1=0;
	vector <pair<int,int>> v;
	while(t--){
        int x,y;
        cin>>x>>y;
        v.pb({x,y});
	}
	for(int i=0;i<v.size()-1;i++){
        for(int j=i+1;j<v.size();j++){
//            cout<<(float)(v[j].ss-v[i].ss)/(v[j].ff-v[i].ff)<<" ";
            if((float)(v[j].ss-v[i].ss)/(v[j].ff-v[i].ff)>=-1 && (float)(v[j].ss-v[i].ss)/(v[j].ff-v[i].ff)<=1)  count1++;
        }
	}

	cout<<count1;
	return 0;
}

//#include<cstdio>
//#include<cassert>
//#include<iostream>
//#include<cstring>
//#include<algorithm>
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define MAX ((int)2e9 + 5)
#define MAXP ((int)1e5 + 5)
#define MAXL ((ll)1e18 + 5)
#define MAX_X ((int)2001)
#define MAX_Y ((int)2001)
#define pi acos(-1)
#define MOD ((int)1e9 + 7)
//#define MOD ((int)998244353 + 0)
#define BAS ((int)1e6 + 3)
//#define BAS ((int)2e5 + 3)
#define N ((int)1e5 + 9)
#define eps (1e-8)
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
#define logn 17
#define endl "\n"
#define mpp make_pair
#define BUCK 105
#define LEF (idx<<1)
#define RIG ((idx<<1)|1)
//#define int ll


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;

/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/




typedef tree < int,  null_type,  less < int >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;
typedef tree < pair < int, int >,  null_type,  less < pair < int, int > >,  rb_tree_tag,  tree_order_statistics_node_update > o_setp;
/// o_set s;
/// s.order_of_key(k) : Number of items strictly smaller than k .
/// *(s.find_by_order(k)) : K-th element in a set (counting from zero).

typedef long double ldd;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int my_rand(int l, int r)
{
    return uniform_int_distribution<int>(l,r) (rng);
}


int arr[N];

ll pre[N];

int main()
{
    fastio;
    int n;
    cin>>n;

    for(int i = 1 ; i<=n ; i++){
        cin>>arr[i];
        arr[i] += arr[i];
    }
    sort(arr+1,arr+n+1);
    for(int i = 1 ; i<=n ; i++) pre[i] = pre[i-1] + arr[i];
    ll ans = MAXL;
    for(int i = 1 ; i<=n ; i++){
        ll sum = 1LL*(i-1)*arr[i]/2 + (pre[n] - pre[i-1]) - 1LL*(n-i+1)*arr[i]/2;
        ans = min(ans , sum);
    }
    cout<<fixed<<setprecision(20);
    cout<<ans/(2.0*n)<<endl;
    return 0;
}
