  /*  Author :    */
#include <bits/stdc++.h>
 
using namespace std;
 
#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define pb push_back
#define ll long long
#define rep(i,n)  for(ll i=0;i<n;i++)
#define rep1(i,n)  for(ll i=n-1;i>=0;i--)
 
#define repi(i,n)  for(ll i=1;i<=n;i++)
#define mem(arr,x) memset(arr,x,sizeof(arr))
 
typedef vector<ll> vi;
typedef vector<char> vc;
     
#define mp make_pair 
#define ss second
 
 
 
const int MAX=100005;
const int mod = 1e9 + 7;  
const int inf = 1e9 + 5;
 
int min(int a,int b)
{
        if(a<b)
        return a;
        return b;
} 
void solve()
{
 ll n;
 cin>>n;
 vector<pair<int,int>>v;
 ll a,q,ans=0;
 for(int i=0;i<n;i++)
 {
  cin>>a>>q;
  v.pb(mp(a,q));
 }
 for(int i=0;i<n;i++)
 {
  int a=v[i].first;
  int b=v[i].second;
  
  for(int j=i+1;j<n;j++)
  {
      int a1=v[j].first;
     int b1=v[j].second;
     if(a1==a)
      continue;
     float p=b1-b;
     float q=a1-a;
     float bb=(float)p/q;
     if(bb>=-1.0 && bb<=1.0)
      ++ans;

   }
 }
 cout<<ans<<'\n';
  
}
 
 int main()
{
  fast_io;
int T=1;
 //cin>>T;
while(T--)
{  
  solve();
  
 }
}
 

 
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <iomanip>
#include <functional>
#include <cassert>
#include <bitset>
#include <chrono>
 
using namespace std;
 
typedef long long ll;
 
int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
#endif
  int n;
  cin >> n;
  vector <int> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
  }
  vector <int> ix(n), iy(n);
  iota(ix.begin(), ix.end(), 0);
  iota(iy.begin(), iy.end(), 0);
  sort(ix.begin(), ix.end(), [&] (int i, int j) {
    return x[i] < x[j];
  });
  sort(iy.begin(), iy.end(), [&] (int i, int j) {
    return y[i] < y[j];
  });
  vector <int> intr;
  for (int i = 0; i < min(n, 3); ++i) {
    intr.push_back(ix[i]);
    intr.push_back(iy[i]);
  }
  for (int i = 0; i < min(n, 3); ++i) {
    intr.push_back(ix[n - i - 1]);
    intr.push_back(iy[n - i - 1]);
  }
  sort(intr.begin(), intr.end());
  intr.resize(unique(intr.begin(), intr.end()) - intr.begin());
  vector <int> vals;
  for (int i : intr) {
    for (int j : intr) {
      if (i < j) {
        vals.push_back(max(abs(x[i] - x[j]), abs(y[i] - y[j])));
      }
    }
  }
  sort(vals.rbegin(), vals.rend());
  cout << vals[1] << '\n';
}

