#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long squaredDistance(pair<ll, ll> &a, pair<ll, ll> &b) {
return (long long)(a.first - b.first) * (a.first - b.first) +
(long long)(a.second - b.second) * (a.second - b.second);
}
bool isRightAngledTriangle(pair<ll, ll> &a, pair<ll, ll> &b, pair<ll, ll> &c) {
long long ab2 = squaredDistance(a, b);
long long bc2 = squaredDistance(b, c);
long long ca2 = squaredDistance(c, a);
if (ab2 == 0 || bc2 == 0 || ca2 == 0) {
return false; // Polls are not distinct
}
return (ab2 + bc2 == ca2) || (ab2 + ca2 == bc2) || (bc2 + ca2 == ab2);
}
int main() {
ll N;
cin >> N;
vector<pair<ll, ll>> polls(N);
for (ll i = 0; i < N; ++i) {
cin >> polls[i].first >> polls[i].second;
}
set<tuple<ll, ll, ll>> uniqueTriangles;
for (ll i = 0; i < N; ++i) {
for (ll j = i + 1; j < N; ++j) {
for (ll k = j + 1; k < N; ++k) {
if (isRightAngledTriangle(polls[i], polls[j], polls[k])) {
vector<ll> indices = {i, j, k};
sort(indices.begin(), indices.end());
uniqueTriangles.insert(make_tuple(indices[0], indices[1], indices[2]));
}
}
}
}
cout << uniqueTriangles.size() << endl;
return 0;
}