#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n;
   cin >> n;
   vector<pair<double,double>> m (n);
   for ( int i = 0; i  < n; i ++ ) {
    cin >> m[i].first >> m[i].second;
   }
   int cnt=0;
    for (int i = 0 ; i < n ; i++){
        for (int j = i+1; j < n; j++){
            if (((m[j].second - m[i].second) / (m[j].first - m[i].first) <=1) &&(m[j].second - m[i].second) / (m[j].first - m[i].first) >=-1)
                cnt++;
               // cout << "m[j].sec = " << m[j].second - m[i].second <<  " m[i].first = " << m[j].first - m[i].first <<  " ==== " << (m[j].second - m[i].second) / (m[j].first - m[i].first)  << " cnt = " <<cnt << endl;
        }
        //cout << endl;
    }
   cout <<cnt<<endl;

   return 0;
      }


#include <bits/stdc++.h>

#define ll long long int
using namespace std;

int main() {
    ll n, f, i, j, a, b;
    cin >> n;
    vector<pair<ll, ll> > vect;
    ll sum = 0;
    for (i = 0; i < n; i++) {
        cin >> a >> b;
        vect.push_back(make_pair(a, b));
    }
    sort(vect.begin(),vect.end());
    ll mn=vect[0].first+vect[0].second;
    for(i=1;i<n;i++)
    {
        mn=min(mn,(max(vect[0].first,vect[i].second)));
    }
    cout<<mn<<endl;
}
