#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
long double pi = 2 * acos(0.0);
const ll mod = 998244353;

void solve() {
    ll n;
    cin >> n;
    vector<pair<ll, ll>> v(n);
    for(ll i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
    ll ans = 0;
    for(ll i = 0; i < n; i++) {
        for(ll j = i + 1; j < n; j++) {
            ld m = (ld)(v[j].second - v[i].second) / (v[j].first - v[i].first);
            if(m >= -1 && m <= 1) ans++;
        }
    }
    cout << ans;
}

int main() {
    ios_base :: sync_with_stdio(false); 
    cin.tie(nullptr);   
    ll t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;  
using ll = long long;

#define rep(i, a, b) for(ll i = a; i < b; i++)
#define Rep(i, a, b) for(ll i = a; i <= b; i++)
#define repr(i, a, b) for(ll i = b-1; i >= a; i--)
// #define _GLIBCXX_DEBUG
template <class T> using V = vector<T>;
#define ALL(v) (v).begin(),(v).end()
#define endl '\n'
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define sz(v) ((ll)(v).size())
const double pi = acos(-1.0);
const ll MOD = 1000000007LL;
// const ll MOD = 998244353LL;
const ll INF = 1LL << 60;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
const int dy2[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx2[] = {1, 1, 0, -1, -1, -1, 0, 1};
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
 
/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/

int main() {
    ll n; cin >> n;
    V<ll> x(n), y(n);
    rep(i, 0, n) cin >> x[i] >> y[i];
    ll ans = 0;
    rep(i, 0, n-1){
        rep(j, i+1, n){
            ll h = abs(y[j]-y[i]);
            ll w = abs(x[j]-x[i]);
            if(h <= w) ans++;
        }
    }
    cout << ans << endl;
}