#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
using P = pair<int,int>;
using vp=vector<P>;
int main(){//cout<<fixed<<setprecision(20);
  int n;
  cin>>n;
  vp a(n);
  rep(i,0,n)cin>>a[i].first>>a[i].second;
  int ans=0;
  rep(i,0,n-1)rep(j,i+1,n)if(abs(a[i].second-a[j].second)<=abs(a[i].first-a[j].first))ans++;
  cout<<ans<<endl;
}
// â��Experience is the name everyone gives to their mistakes.â�� â�� Oscar Wilde
// Take care of mod becoming -ve

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define fro(i, s, e) for (auto i = s; i <= e; ++i)
#define int long long
#define ld long double
#define fr(i, n) for (int i = 0; i < n; i++)
#define ff first
#define ss second
#define mp make_pair
#define vi std::vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define setbits(x) __builtin_popcountll(x)
#define zrbits(x) __builtin_ctzll(x)
#define tc    \
    int t;    \
    cin >> t; \
    while (t--)
#define FILE                          \
    freopen("input.txt", "r", stdin); \
    freopen("output.txt", "w", stdout)
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
#define ps(x, y) fixed << setprecision(y) << x
#define endl "\n"
#define rev(i, e, s) for (auto i = e; i >= s; --i)
#define mod 1000000007
#define min_pq priority_queue<int, std::vector<int>, greater<int>>
#define printclock cerr << "Time : " << 1000 * (ld)clock() / (ld)CLOCKS_PER_SEC << "ms\n";
using namespace std;
const int N = 1e5 + 5;
const int inf = 1000000000000000000;
#define fit(s, x) memset(s, x, sizeof(s));
#define out(x) cout << x << "\n"
#define deb(x) cout << #x <<": "<< x << "\n"
#define fr1(i, n) for (int i = 1; i <= n; i++)
#define pi 3.14159265358979323846264338327950
typedef tree<int, null_type, less<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        PBDS;
#define debug(...) cerr<<" ["<<#__VA_ARGS__": "<<(__VA_ARGS__)<<"] "
// Use __gcd(a,b) for gcd
// find(all(x),key) to get the iterator and its index is obtained by find(all(x),key)-x.begin()
// find_if(iterator_first,iterator_last,unary function) returns first iterator if any element corresponding to unary function exists and if no such element is found it retrurns the last iterator
/*For example:
find_if(all(x),isodd) for x being a vector{10,25,40,55}; *it returns 25*/
/*search(all(v1),all(v2),pred) searches for all the elements of v2 present in v1 based on pred function the iterator correspond
to the first element of sequence if it exists and if not then th elast iterator is obtained.*/
//use substr(size_t pos,size_t len) for the substrings
// iota(forward itr,backwrd itr,val) can be used for consecutive numbers
//use emplace_back in vector
int power(int a, int b, int m = mod)
{
  long long ans = 1;
  while (b > 0)
  {
    if (b & 1LL)
    {
      ans = (ans * a) % mod;
    }
    a = (a * a) % mod;
    b = (b >> 1LL);
  }
  return ans;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }

  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
int modInv(int a, int m = mod) {
  return power(a, m - 2, m); //m is prime
}
int dx[8] = {0, 1, 0, -1, -1, -1, 1, 1} ;
int dy[8] = {1, 0, -1, 0, -1, 1, 1, -1} ;
int get(int n) {
  int ans = 0;
  while (n) {
    ans += (n % 10);
    n /= 10;
  }
  return ans;
}
inline void solve() {
  int n;
  cin >> n;
  std::vector<pii> v(n);
  fr(i, n) {
    int x, y;
    cin >> x >> y;
    v[i].ff = x;
    v[i].ss = y;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; ++j) {
      ld slope = abs((ld)(v[j].ss - v[i].ss) / (v[j].ff - v[i].ff));
      if (slope <= 1) {
        ans++;
      }
    }
  }
  out(ans);
}
int32_t main()
{
  fio;
#ifndef ONLINE_JUDGE
  FILE;
#endif
  // tc{
  //   solve();
  // }
  solve();
  printclock;
  return 0;
}