#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, x = 0, y = 0, ans = 0;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  if (n < 4) {
    cout << "0" << endl;
    return 0;
  }
  for (i = n - 2; i >= 0; i--) {
    if (a[i] == a[i + 1] || a[i + 1] - 1 == a[i]) {
      if (!x)
        x = a[i];
      else {
        y = a[i];
        ans += x * y;
        x = y = 0;
      }
      i--;
    }
  }
  cout << ans << endl;
  return 0;
}
