#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

int main()
{
int n;
cin >> n;
vector<pair<int, int>> coordinates;
for (int i = 0; i < n; i++)
{
    int x, y;
    cin >> x >> y;
    coordinates.emplace_back(make_pair(x, y));
}

long long result = 0;
for (int i = 0; i < n; i++)
{
    for (int j = i + 1; j < n; j++)
    {
        long long a = coordinates[i].first - coordinates[j].first;
        long long b = coordinates[i].second - coordinates[j].second;
        if (a * a + b * b <= 4)
        {
            result++;
        }
    }
}

cout << result << endl;

return 0;
}