#include <cstdlib>
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;



void GP(){
    int N;
    cin >> N;
    int x[N],y[N];
    rep(i,N){
        cin >> x[i] >> y[i];
    }
    int ans=0;
    rep(i,N){
        rep(j,i){
            double P = abs(y[i]-y[j])/((double)abs(x[i]-x[j]));
            if(abs(P)<=1){
                ans++;
            }
        }
    }
    cout << ans << endl;
}
int main(){
    GP();
    return 0;
}
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <functional>
#include <iomanip>
#include <cstdint>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tpiii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector
#define vi vec<int>
#define vl vec<ll>
#define vvi vec<vi>
#define vvl vec<vl>
#define vpii vec<pii>
#define vpll vec<pll>
#define vbl vec<bool>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
string stin(){string s;cin>>s;return s;}
void drop(string s){cout<<s<<endl; exit(0);}
void drop(int x){cout<<x<<endl; exit(0);}
void drop(ll x){cout<<x<<endl; exit(0);}
void drop(double x){cout<<x<<endl; exit(0);}

int main(){
    int n=in();
    vi x(n),y(n);
    rep(i,n){
        x[i]=in();
        y[i]=in();
    }
    int cnt=0;
    rep(i,n)rep2(j,i+1,n-1)if(abs(x[i]-x[j])>=abs(y[i]-y[j]))cnt++;
    drop(cnt);
}