#include <bits/stdc++.h>
using namespace std;
long long a[100200];
pair<long long, long long> b[100200];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  reverse(a, a + n);
  int l = 0, r = 0;
  long long s = 0;
  while (r < n - 1) {
    if (a[r] > a[r + 1] + 1)
      r++;
    else {
      b[l].first = a[r];
      b[l].second = a[r + 1];
      r += 2;
      l++;
    }
  }
  for (int i = 0; i < l; i += 2) {
    s = s + (b[i].second * b[i + 1].second);
  }
  cout << s;
  return 0;
}
