output_description: Print the maximum possible area of the rectangle. If no rectangle can be
  formed, print 0.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 ... A_N
attempt: from statistics import mean, median, variance, stdev
  import numpy as np
  import sys
  import math
  import fractions
  import itertools
  import copy
  import collections
  from operator import itemgetter
  
  
  # 以下てんぷら
  def j(q):
      if q == 1:
          print("Yes")
      elif q == 0:
          print("No")
      exit(0)
  
  
  """
  def ct(x,y):
      if (x>y):print("+")
      elif (x<y): print("-")
      else: print("?")
  """
  
  
  def ip():
      return int(input())
  
  
  def printrow(a):
      for i in range(len(a)):
          print(a[i])
  
  
  def combinations(n, r):
      if n < r:
          return 0
      return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
  
  def permutations(n, r):
      if n < r:
          return 0
      return math.factorial(n) // math.factorial(n - r)
  
  
  def lcm(x, y):
      return (x * y) // fractions.gcd(x, y)
  
  
  n = ip()  # 入力整数1つ
  # h,m= (int(i) for i in input().split())       #入力整数横2つ以上
  a = [int(i) for i in input().split()]  # 入力整数配列
  # a = input()                                  #入力文字列
  # a = input().split()                          #入力文字配列
  # n = ip()                      #入力セット(整数改行あり)(1/2)
  # a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
  # a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
  # jの変数はしようできないので注意
  # 全足しにsum変数使用はsum関数使用できないので注意
  # こっから本文
  a.sort()
  c = 1
  cnum = a[0]
  s = []
  for i in range(1, n):
      if a[i] != cnum:
          if c > 1:
              s.append(cnum)
          if c > 3:
              s.append(cnum)
          c = 1
          cnum = a[i]
      else:
          c += 1
  if c > 1:
      s.append(cnum)
  if c > 3:
      s.append(cnum)
  s.sort(reverse=True)
  if len(s) < 2:
      print(0)
  else:
      print(s[0] * s[1])
  
problem_description: Statement
  
  We have N sticks with negligible thickness. The length of the i-th stick is
  A_i.
  
  Snuke wants to select four different sticks from these sticks and form a
  rectangle (including a square), using the sticks as its sides. Find the
  maximum possible area of the rectangle.
samples: [{"input": "6\n    3 1 2 4 2 1", "output": "2\n    \n\n1 \\times 2 rectangle can be formed.\n\n* * *"}, {"input": "4\n    1 2 3 4", "output": "0\n    \n\nNo rectangle can be formed.\n\n* * *"}, {"input": "10\n    3 3 3 3 4 4 4 5 5 5", "output": "20"}]