{$apptype console}

// (C) Timofey S. Chistyakov 2005

uses
  CLasses, Math, Types;

var
  n: integer;
  x, y: TIntegerDynArray;

function Cmp(X1, Y1, X2, Y2: integer): integer;
begin
  Result := X1 - X2;
  if Result = 0 then
    Result := Y1 - Y2;
end;

procedure QSort(L, R: integer);
var
  I, J, P: integer;
  t: integer;
begin
  repeat
    I := L;
    J := R;
    P := (L + R) shr 1;
    repeat
      while Cmp(x[i], y[i], x[p], y[p]) < 0 do Inc(I);
      while Cmp(x[j], y[j], x[p], y[p]) > 0 do Dec(J);
      if I <= J then
      begin
        t := x[i]; x[i] := x[j]; x[j] := t;
        t := y[i]; y[i] := y[j]; y[j] := t;
        if P = I then
          P := J
        else if P = J then
          P := I;
        Inc(I);
        Dec(J);
      end;
    until I > J;
    if L < J then QSort(L, J);
    L := I;
  until I >= R;
end;


function Find(xx, yy: integer): boolean;
var
  l, r, m: integer;
  cr: integer;
begin
  l := 0;
  r := n - 1;
  while l <= r do begin
    m := (l + r) div 2;
    cr := Cmp(xx, yy, x[m], y[m]);
    if cr = 0 then begin
      Result := true;
      Exit;
    end;
    if cr < 0 then
      r := m - 1
    else
      l := m + 1;
  end;
  Result := false;
end;

var
  fi, fo: textfile;
  i, j: integer;
  res: integer;
  cx, cy, dx, dy, lx, ly, rx, ry: extended;
begin
  Read(n);
  Assert(InRange(N, 1, 2000));
  SetLength(x, n);
  SetLength(y, n);

  for i := 0 to n - 1 do begin
    Read(x[i], y[i]);
    Assert(InRange(x[i], -10000, 10000));
    Assert(InRange(y[i], -10000, 10000));
  end;

  for i := 0 to n - 1 do
    for j := i + 1 to n - 1 do
      Assert((x[i] <> x[j]) or (y[i] <> y[j]));

  QSort(0, n - 1);
  res := 0;
  for i := 0 to n - 1 do
    for j := 0 to n - 1 do begin
      if i = j then
        Continue;
      cx := (x[i] + x[j]) / 2;  cy := (y[i] + y[j]) / 2;
      dx := (x[j] - x[i]) / 2;  dy := (y[j] - y[i]) / 2;
      lx := cx - dy; ly := cy + dx;
      rx := cx + dy; ry := cy - dx;

      if (lx = Trunc(lx)) and (ly = Trunc(ly)) then 
        if Find(Trunc(lx), Trunc(ly)) and Find(Trunc(rx), Trunc(ry)) then
          Inc(res);
    end;
    
  Write(res div 4);
end.
