#include <bits/stdc++.h>
using namespace std;
ifstream f("date.in");
ofstream g("date.out");
long long v[100000];
int main() {
  long long n, i, x, y, z, t, s = 0;
  cin >> n;
  for (i = 0; i < n; ++i) cin >> v[i];
  sort(v, v + n);
  i = n - 1;
  x = y = z = t = 0;
  while (i > 0) {
    if (x == 0) {
      if (v[i - 1] + 1 >= v[i]) {
        x = v[i];
        z = v[i - 1];
        --i;
      }
    } else if (y == 0) {
      if (v[i - 1] + 1 >= v[i]) {
        y = v[i];
        t = v[i - 1];
        --i;
      }
    }
    if (y != 0) {
      s += z * t;
      x = y = z = t = 0;
    }
    --i;
  }
  cout << s;
}
