#include<bits/stdc++.h>
using namespace std;
#define fo(i,k,n) for(long long i=k;i<n;i++)
#define endl "\n"
#define pb push_back
#define vii vector<ll>
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

typedef long long ll;

/* ll fun_ceil(ll n,ll k){
if(n%k==0){
    return n/k;
}
else {
    ll x = (n/k)+1;
    return x;
}
} */
//sort(s.begin(),s.end(),[](tt x, tt y){return abs(x)>abs(y);});
void calc(){
    double n;cin>>n;
    vector<pair<double,double>> s(n);
    fo(i,0,n)
        cin>>s[i].first>>s[i].second;
    double ans = 0;
    fo(i,0,n){
        fo(j,i+1,n){
            double temp = (s[j].second-s[i].second)/(s[j].first-s[i].first);
            if(temp>=-1.0 and temp<=1.0)
                ans++;
        }
    }
    cout<<ans;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    
        calc();
    
    return 0;
}

	#include <sstream>
	#include <queue>
	#include <stack>
	#include <set>
	#include <map>
	#include <cstdio>
	#include <cstdlib>
	#include <cctype>
	#include <complex>
	#include <malloc.h>
	#include <cmath>
	#include <iostream>
	#include <string>
	#include <vector>
	#include <algorithm>
	#include <bitset>
	#include <list>
	#include <string.h>
	#include <assert.h>
	#include  <time.h>
	using namespace std;
 
	/*
	   ____   U  ___ u  ____            U _____ u ____    _    
	U /"___|   \/"_ \/U|  _"\ u  ___    \| ___"|/|  _"\ U|"|u  
	\| | u     | | | |\| |_) |/ |_"_|    |  _|" /| | | |\| |/  
	 | |/__.-,_| |_| | |  __/    | |     | |___ U| |_| |\|_|   
	  \____|\_)-\___/  |_|     U/| |\u   |_____| |____/ u(_)   
	 _// \\      \\    ||>>_.-,_|___|_,-.<<   >>  |||_   |||_  
	(__)(__)    (__)  (__)__)\_)-' '-(_/(__) (__)(__)_) (__)_) 
	*/
	                                
	#define ll long long
	#define all(v) ((v).begin()), ((v).end())
	// #define sort(a,n) 	sort(a , a+n) ;
	#define uf(x) cout << (x) << '\n';
	#define in(x) cin >> x ;
	#define deb(x) cerr << #x << "=" << x << endl
	#define forn(i, n) for(int i = 0; i < int(n); ++i)
	#define lp(i, e, n) for(ll i = e; i < n; i++)
	#define rep(i, a, b) for (int _end_ = (b), i = (a); i <= _end_; ++i)
	#define fre(i, a, b) for (int _end_ = (b), i = (a); i >= _end_; ++i)
	#define WX(YZ) while(TEST--)
	#define FAST ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
	#define ps(x, y) fixed<<setprecision(y)<<x
	#define mx 0;
	#define sx(x) (int)x.size()
	#define yes cout << "YES" << endl;
	#define no cout << "NO" << endl;
	
	//life is more about the journey, than it is of the destination
	typedef int int32_t;
	typedef pair<int, int> ii;
	typedef vector<int> v;
 
	template<typename... T>
	void rd(T&... args) {
		((cin >> args), ...);
	}
	template<typename... T>
	void yk(T&&... args) {
	    ((cout << args << ' '), ...);
	}
	template<typename... T>
	void ew(T&&... args) {
	    ((cout << args << '\n'), ...);
	}
 
	const char nl = '\n';
	const int maxn = 2e5 + 17;
	const int INF = 2000 * 1000 * 1000;
 
	ll gcd(long long int a, long long int b)
	{
	    if (b == 0)
	        return a;
	    return gcd(b, a % b);
	}
	 
	ll lcm(ll a, ll b)
	{	
	    return (a / gcd(a, b)) * b;
	}
 	//l, u, d, rd, ru, ld, lu/
	void notToday(){
		    int n;
    cin >> n;
    vector<int> x(n),y(n);
    for(int i=0;i<n;++i)
        cin >> x[i] >> y[i];
    int ans = 0;
    for(int i=0;i<n;++i)
    {
        for(int j=i+1;j<n;++j)
        {
            if(abs(x[i]-x[j])>=abs(y[i]-y[j]))
                ++ans;
        }
    }
    cout << ans << "\n";
	} 
	/* 
	no thats not me.
	*/
	int32_t main(void){
		//freopen("input.txt", "r", stdin);
		//freopen("output.txt", "w", stdout);
		FAST;
		ll TEST = 1;	
		// cin >> TEST;
		WX(YZ){
			notToday();
		}
	//exetime
	return mx
	}
