input: from typing import List
  
  def count_upper_left_pairs(points: List[List[int]]) -> int:
      """
      You are given a 2D array points consisting of n elements, each of which is an integer coordinate on a 2D plane where points[i] = [xi, yi].
  
      Determine the number of pairs of points (A, B) such that A is located on the upper left side of B, with no other points present in the rectangle or line formed between them (including the border).
  
      Return this count.
  
      Examples:
      >>> points = [[1,1],[2,2],[3,3]]
      0
      >>> points = [[6,2],[4,4],[2,6]]
      2
      >>> points = [[3,1],[1,3],[1,1]]
      2
  
      Constraints:
      2 <= n <= 50
      points[i].length == 2
      0 <= points[i][0], points[i][1] <= 50
      All points[i] are unique.
      """
output:     
      count = 0
      for i in range(len(points)):
          for j in range(len(points)):
              if i != j and points[i][0] < points[j][0] and points[i][1] < points[j][1]:
                  valid = True
                  for k in range(len(points)):
                      if k != i and k != j:
                          if points[i][0] < points[k][0] < points[j][0] and points[i][1] < points[k][1] < points[j][1]:
                              valid = False
                              break
                  if valid:
                      count += 1
      return count
  