#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// agr set ki tarah krna hai to less vrna agr multiset ki tarah to less_equal
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

long long int mod97 = 1000000007;
long long int modg = 998244353;
double pi = 3.1415926536;
bool comp(pair<long long int, long long int>a, pair<long long int, long long int>b)
{
    if (a.first == b.first)
    {
        if (a.second <= b.second)
            return true;
        else
            return false;
    }
    if (a.first > b.first)
        return true;
    else return false;
}
bool rev(long long int a, long long int b)
{
    if (a > b)return true;
    else return false;
}
bool compa(pair<string, pair<int, int>>a, pair<string, pair<int, int>>b)
{
    if (a.first == b.first)
    {
        if (a.second.first > b.second.first)
            return true;
        else
            return false;
    }
    if (a.first < b.first)
        return true;
    else
        return false;
}
long long int gcd(long long int bdda, long long int chota)
{
    if (chota == 0)
        return bdda;
    return gcd(chota, bdda % chota);
}
long long int lcm(long long int a, long long int b)
{
    return a * b / gcd(max(a, b), min(a, b));
}
long long int powerm(long long int a, long long int n, long long int modn)
{
    if (n == 0)return 1;
    if (n % 2 == 0)
    {
        long long int val = powerm(a, n / 2, modn);
        val = (val * val) % modn; return val;
    }
    else
    {
        long long int val = powerm(a, n / 2, modn);
        val = ((val * val) % modn * a) % modn; return val;
    }
}
long long int power(long long int a, long long int n)
{
    if (n == 0)return 1;
    if (n % 2 == 0)
    {
        long long int val = power(a, n / 2);
        val = (val * val); return val;
    }
    else
    {
        long long int val = power(a, n / 2);
        val = ((val * val) * a) ; return val;
    }
}
bool comppp(string a, string b)
{
    if (a.size() > b.size())return true;
    else return false;
}
bool compp(pair<long long int, long long int>a, pair<long long int, long long int>b)
{
    if (a.second < b.second)
        return true;
    else if (a.second > b.second)
        return false;
    else
    {
        if (a.first < b.first)return true;
        else return false;
    }
}
bool compar(pair<long long int, long long int>a, pair<long long int, long long int>b)
{
    if (a.second < b.second)return true;
    else if (a.second > b.second)return false;
    else
    {
        if (a.first >= b.first)return true; else return false;
    }
}


void solve()
{
    long long int n; cin >> n; pair<long long int, long long int>a[n];
    for (long long int i = 0; i < n; i++)cin >> a[i].first >> a[i].second;
    long long int ans = 0; sort(a, a + n);
    for (long long int i = 0; i < n; i++)
    {
        for (long long int j = i + 1; j < n; j++)
        {
            long long int dx = a[j].first - a[i].first, dy = a[j].second - a[i].second;
            if (abs(dx) >= abs(dy))ans++;
        }
    }
    cout << ans << endl;

}



int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    t = 1;
    //cin >> t;// long long int count = 1;
    while (t--)
    {
        //cout << "Case #" << count << ": ";
        solve();
        //count++;
    }
}
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    int N; cin >> N;
    vector<int> A(N);
    REP(i, 0, N) cin >> A[i];

    int ans = 1 << 30;
    REP(i, 0, 1 << N) {
        int x = 0, d = i & 1, o = A[0];
        REP(j, 1, N) {
            if (i & (1 << j)) {
                if (d) {
                    o |= A[j];
                } else {
                    x ^= o;
                    o = A[j];
                    d = 1;
                }
            } else {
                if (d) {
                    x ^= o;
                    o = A[j];
                    d = 0;
                } else {
                    o |= A[j];
                }
            }
        }
        x ^= o;
        ans = min(ans, x);
    }
    cout << ans << endl;
    return 0;
}
