#include <bits/stdc++.h>
using namespace std;

int main(){
    int N, count = 0;
    double tmp;
    cin >> N;
    vector<int> x(N), y(N);
    for(int i = 0; i < N; i++)
        cin >> x.at(i) >> y.at(i);
    for(int i = 0; i < N; i++){
        for(int j = i+1; j < N; j++){
            tmp = (double)y.at(i) - y.at(j);
            tmp /= (double)x.at(i) - x.at(j);
            if(-1 <= tmp && tmp <= 1) count++;
        }
    }
    cout << count << endl;
}
#include <iostream>
#include <vector>
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> x(n), y(n);
	rep(i, 0, n) {
		cin >> x[i] >> y[i];
	}
	
	int dx, dy, cnt = 0;
	double t;
	rep(i, 0, n - 1) rep(j, 0, n) {
		if (i < j) {
			dx = x[j] - x[i];
			dy = y[j] - y[i];
			t = (double)dy / (double)dx;
			if (abs(t) <= 1) {
				cnt++;
			}
		}
	}
	
	cout << cnt;

	return 0;
}

