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: def inpl():
      return [int(i) for i in input().split()]
  
  
  H, W = inpl()
  ans = max(H, W)
  S = ""
  for _ in range(H):
      S += input()
  T = [[0] * (W - 1)]
  for i in range(H - 1):
      t = []
      for j in range(W - 1):
          r = (
              S[i * W + j]
              + S[i * W + j + 1]
              + S[(i + 1) * W + j]
              + S[(i + 1) * W + j + 1]
          )
          t.append(r.count(".") % 2)
      ts = [0] * (W - 1)
      for i, k in enumerate(t):
          if k:
              continue
          ts[i] = T[-1][i] + 1
      T.append(ts)
  for iT in T[1:]:
      stack = []
      for i, l in enumerate(iT):
          while stack:
              w, h = stack[-1]
              if h > l:
                  dw, dh = stack.pop()
                  ans = max(ans, (dh + 1) * (i - dw + 1))
                  continue
              break
          stack.append((i, l))
      while stack:
          dw, dh = stack.pop()
          ans = max(ans, (dh + 1) * (i - dw + 2))
  print(ans)
  
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"}]