#include <bits/stdc++.h>
using namespace std;
long long a[1000009];
int pre[10000009];
vector<long long> alr;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  reverse(a, a + n);
  long long ans = 0, ans1 = 0;
  int taken = 0;
  for (int i = 0; i < n; i++) {
    pre[a[i]]++;
  }
  for (int i = 0; i < n; i++) {
    if (pre[a[i]] % 2 == 1) {
      if (pre[a[i] - 1] > 0)
        pre[a[i]]--, pre[a[i] - 1]++;
      else
        pre[a[i]]--;
    }
  }
  int x = 0, y = 0, l = 0, r = 2;
  while (l < n && r < n) {
    if (pre[a[l]] >= 2 && pre[a[r]] >= 2) {
      if (a[l] == a[r] && pre[a[r]] < 4) {
        r++;
        continue;
      }
      pre[a[l]] -= 2;
      pre[a[r]] -= 2;
      ans += a[l] * a[r];
    } else if (pre[a[r]] < 2 && pre[a[l]] >= 2)
      r++;
    else if (pre[a[r]] >= 2 && pre[a[l]] < 2)
      l++;
    else if (pre[a[r]] < 2 && pre[a[l]] < 2)
      l++, r++;
  }
  cout << ans << endl;
}
