#include <bits/stdc++.h>
using namespace std;
long long rrow[150000];
int main() {
  int r;
  cin >> r;
  for (int a = 0; a < r; a++) cin >> rrow[a];
  sort(rrow, rrow + r);
  long long r1 = 0, r2 = 0;
  long long ans = 0;
  for (int a = r - 1; a >= 0; a--) {
    if (a != 0 && rrow[a] - rrow[a - 1] < 2) {
      if (r1 == 0)
        r1 = rrow[a - 1];
      else if (r2 == 0)
        r2 = rrow[a - 1];
      a--;
    }
    if (r2 != 0) ans += r1 * r2, r1 = 0, r2 = 0;
  }
  cout << ans << endl;
}
