#include <bits/stdc++.h>
using namespace std;
long long a[100010], b[100010], i, n, x, y, mx, s, k;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  for (i = n; i > 1; i--) {
    if (a[i] - a[i - 1] <= 1) {
      k++;
      if (k == 2) {
        s = s + x * a[i - 1];
        k = 0;
      } else
        x = a[i - 1];
      i--;
    }
  }
  cout << s;
  return 0;
}
