package bill;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.*;


class Point {
    private int x;
    private int y;

    Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Point point = (Point) o;
        return x == point.x &&
                y == point.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
}

class Vector {
    private int x;
    private int y;

    Vector(int x, int y) {
        this.x = x;
        this.y = y;
    }

    int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
}


public class Vision {

    public static final String SEPARATOR = " ";

    public static boolean testVector(Set<Point> blendedImage, List<Point> blendedImageList, Vector vector)
    {
        Set<Point> maskSet = new HashSet<>();
//        maskSet.add(blendedImageList.get(0));
        for (int i = 0; i < blendedImageList.size(); i++) {
            Point point = blendedImageList.get(i);
            Point translated = new Point(point.getX() + vector.getX(), point.getY() + vector.getY());
            if(blendedImage.contains(translated))
            {
                maskSet.add(point);
                maskSet.add(translated);
            }
        }
        return maskSet.size() == blendedImage.size();
    }



    public static void main(String[] args) {
        // write your code here
        try {
//            BufferedReader bf = new BufferedReader(new FileReader("input.txt"));
            BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
            int starNumber = Integer.parseInt(bf.readLine());
            Set<Point> blendedImageSet = new HashSet<>();
            List<Point> blendedImageList = new ArrayList<>();
            Point topLeftMost = null;
            for (int i = 0; i < starNumber; i++) {
                String[] split = bf.readLine().split(SEPARATOR);
                Point current = new Point(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
                if (topLeftMost == null || (current.getY() < topLeftMost.getY() || (current.getY() == topLeftMost.getY() && current.getX() < topLeftMost.getX()))) {
                    topLeftMost = current;
                }
                blendedImageList.add(current);
            }
            blendedImageSet = new HashSet<>(blendedImageList);

            int posibleTraslationNumber = 0;
            for (int i = 0; i < blendedImageList.size(); i++) {
                Point currPoint = blendedImageList.get(i);
                if(!currPoint.equals(topLeftMost))  {
                    Vector vector = new Vector(currPoint.getX() - topLeftMost.getX(), currPoint.getY() - topLeftMost.getY());
                    if (testVector(blendedImageSet, blendedImageList, vector))
                    {
                        posibleTraslationNumber++;
                    }
                }
            }
            System.out.println(posibleTraslationNumber * 2);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}

