#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.rbegin(), a.rend());
  long long l = -1, b = -1;
  long long area = 0;
  for (long long i = 0; i + 1 < n; i++) {
    if (l == -1 && (a[i] == a[i + 1] || a[i] == a[i + 1] + 1)) {
      l = min(a[i], a[i + 1]);
      i += 1;
    } else if (b == -1 && (a[i] == a[i + 1] || a[i] == a[i + 1] + 1)) {
      b = min(a[i], a[i + 1]);
      i += 1;
    }
    if (l != -1 && b != -1) {
      area += l * b;
      l = -1;
      b = -1;
    }
  }
  cout << area << endl;
  return 0;
}
