#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100005];
int check(int vt) {
  while (abs(a[vt] - a[vt - 1]) > 1) {
    vt--;
  }
  return vt - 1;
}
void solve() {
  long long i, duoi, vtR, vtL, da;
  da = 0;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  duoi = n;
  while (duoi > 0) {
    vtR = check(duoi);
    vtL = check(vtR - 1);
    da += min(a[vtR], a[vtR + 1]) * min(a[vtL], a[vtL + 1]);
    duoi = vtL - 1;
  }
  cout << da << endl;
}
int main() {
  while (cin >> n) solve();
  return 0;
}
