{$APPTYPE CONSOLE}

var
  f: TextFile;
  x, y: array of Integer;
  i, j, k, c, N, side, squares: Integer;

  function dist2(pt1, pt2: Integer): Integer;
  begin
    Result := Sqr(x[pt1] - x[pt2]) + Sqr(y[pt1] - y[pt2]);
  end;

begin
//  AssignFile(f, 'input.txt'); Reset(f);
  Read(N);
  SetLength(x, N + 1);
  SetLength(y, N + 1);
  for i := 1 to N do Read(x[i], y[i]);
//  CloseFile(f);
  squares := 0;
  for i := 1 to N - 1 do begin
    for j := i + 1 to N do begin
      side := dist2(i, j);
      if side mod 2 = 1 then continue;
      side := side div 2;
      c := 0;
      for k := i + 1 to N do begin
        if (dist2(i, k) = side) and (dist2(j, k) = side) then begin
          Inc(c);
          if c = 2 then break;
        end;
      end;
      if c = 2 then Inc(squares);
    end;
  end;
//  AssignFile(f, 'output.txt'); Rewrite(f);
  Write(squares);
//  CloseFile(f);
end.


