10
-2 1
2 -2
-1 -2
0 0
2 -1
0 -2
2 2
0 2
-1 -1
1 -2
 40
-8 24
2 -1
1 -18
72 -70
5 -4
-308 436
-19 40
36 -35
-178 265
-1 2
-7 30
-1 0
3 -2
200 -285
17 -16
-35 74
0 -4
-86 106
-1 4
-7 6
0 1
-5 4
-2 3
6 -5
-4 5
181 -262
76 -118
0 0
-7 18
-58 104
-5 6
-6 12
-3 4
1 0
11 -10
-86 130
-3 6
153 -236
-183 270
-33 64
 5
0 -1
0 -2
0 -3
0 -4
0 -5
 10
0 1
-1 -1
1 1
-1 0
1 -1
-2 -1
-2 2
-2 0
0 -2
0 -1
 20
-1 18
-2 5
-5 4
2 -33
9 -18
0 0
11 -22
2 0
-1 2
-4 41
1 6
1 -2
6 -12
0 1
-3 6
3 -6
3 -8
-1 4
2 -5
1 0
 10
2 1
-1 0
-2 -1
-1 1
0 2
2 -2
0 0
-2 -2
0 -2
-2 1
 20
-3 -3
0 4
-3 1
1 1
-1 2
-4 4
3 -1
-3 0
0 2
4 0
2 3
2 4
4 -3
-4 3
-1 1
1 3
-2 4
1 -2
1 -1
3 0
 3
0 0
0 -1
0 1
 10
2 1
-1 1
0 0
-3 1
-2 -3
-1 -2
-1 -1
1 2
3 -2
0 -2
 3
3 3
1 2
1 1
 4
0 0
1 0
2 0
3 0
 9
1 1
1 0
0 1
0 0
-1 0
-1 1
-1 -1
1 -1
0 -1
 7
1 1
-1 -1
1 0
0 1
-1 0
0 -1
0 0

4
 57
 4
 5
 21
 4
 10
 1
 1
 0
 2
 8
 3

// --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
//if anything breaks refresh from https://ideone.com/jiWgII
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")\
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// -------------------</optimizations>--------------------

// ---------------<Headers and namespaces>----------------
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define mod2 998244353
#define int long long
#define lcm(a, b) (a/__gcd(a, b))*b
#define endl '\n'
#define cntbits(x) __builtin_popcountll(x)
#define cntzero(x) __builtin_ctzll(x) //count the number of zeros before the first occurence of '1' form right (S & (-S))
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define setAll(S, n) (S = (1 << n) - 1)
#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
#define mk(arr, n, type) type *arr=new type[n]
#define vi vector<int>
#define mp make_pair
#define umi unordered_map<int, int>
#define mi map<int, int>
#define usi unordered_set<int>
#define si set<int>
#define umc unordered_map<char, int>
#define mc map<char, int>
#define usc unordered_set<char>
#define sc set<char>
#define pi pair<int,int>
#define vc vector<char>
#define pb push_back
#define F first
#define S second
#define w(x) int x; cin >> x; while(x--)
#define print(t) cout << t << endl
#define print2(t1, t2) cout << t1 << " " << t2 << endl
#define in(arr, n) for(int i=0; i<n; i++) cin >> arr[i];
#define REP(k, n) for(int i=k; i<=n; i++)
#define deb(x) cout<< #x << " " << x << "\n";
#define deb2(x, y) cout << #x << " = " << x << ", " << #y << " = " << y << "\n";
#define deb3(x, y, z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << "\n";
#define PI 3.1415926535897932384626
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //shuffle(arr, arr+n, rng);

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash {
    int operator()(int x) const { return x ^ RANDOM; }
};

struct pair_chash {
    int operator()(pi x) const { return x.first * 31 + x.second; }
};

typedef gp_hash_table<int, int, chash> table;
typedef gp_hash_table<pi, int, pair_chash> ptable;

/**
 * Limits in C++ for reference
 * _____________________________________________________________________________________
 * |Sr| Macro Name | Description                     | Value
 * |No|____________|_________________________________|__________________________________
 * |1.| ULLONG_MAX | Maximum value unsigned long long| 18,446,744,073,709,551,615 (10^20)
 * |2.| LLONG_MAX  | Maximum value long long         | 9,223,372,036,854,775,807 (10^19)
 * |3.| LLONG_MIN  | Minimum value long long         |-9,223,372,036,854,775,808 -1*(10^19)
 * |4.| INT_MAX    | Maximum value int               | 2,147,483,647 (10^10)
 * |5.| INT_MIN    | Minimum value int               |-2,147,483,648 (10^10)
*/

/*
          .  .
          |\_|\
          | a_a\
          | | "]
      ____| '-\___
     /.----.___.-'\
    //        _    \
   //   .-. (~v~) /|
  |'|  /\:  .--  / \
 // |-/  \_/____/\/~|
|/  \ |  []_|_|_] \ |
| \  | \ |___   _\ ]_}
| |  '-' /   '.'  |
| |     /    /|:  |
| |     |   / |:  /\
| |     /  /  |  /  \
| |    |  /  /  |    \
\ |    |/\/  |/|/\    \
 \|\ |\|  |  | / /\/\__\
  \ \| | /   | |__
       / |   |____)
       |_/
*/

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

struct s
{
    pi x; pi y; pi z;
    bool operator==(const s &p) const
    {
        bool a = (p.x.F == x.F);
        bool b = (p.x.S == x.S);
        bool c = (p.y.F == y.F);
        bool d = (p.y.S == y.S);
        bool e = (p.z.F == z.F);
        bool f = (p.z.S == z.S);
        if (a and b and c and d and e and f) return 1;
        return 0;
    }
};

bool contain(vector<s>& contains, pi left, pi point, pi right)
{
    s tmp = {left, point, right};
    if (contains.size() == 0) return 0;
    for (auto elem : contains)
    {
        if (elem == tmp) return 1;
    }
    return 0;
}

int32_t main()
{
    c_p_c();
    //clock_t begin, end;    double time_spent;
    //begin = clock();

    int n; cin >> n;
    vector<pi> points(n);
    REP(0, n - 1) cin >> points[i].F >> points[i].S;
    int ans = 0;
    vector<s> contains;
    for (int i = 0; i < n; i++)
    {
        pi point = points[i];
        for (int j = 0; j < n; j++)
        {
            if (j != i)
            {
                pi left = points[j];
                if (left.F <= point.F and left.S <= point.S)
                {
                    int req_x = point.F - left.F;
                    int req_y = point.S - left.S;
                    for (int k = 0; k < n; k++)
                    {
                        if (k != j)
                        {
                            pi right = points[k];
                            if (right.F >= point.F and right.S >= point.S and
                                    right.F - point.F == req_x and right.S - point.S == req_y and
                                    !contain(contains, left, point, right))
                            {
                                //deb2(left.F, left.S);
                                //deb2(point.F, point.S);
                                //deb2(right.F, right.S);
                                ans++;
                                s tmp = {left, point, right};
                                contains.pb(tmp);
                            }
                        }
                    }
                }
            }
        }
    }
    print(ans);


    //end = clock();
    //time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
    //cout << "Time spent = " << time_spent << endl;
    return 0;
}