#include <bits/stdc++.h>
using namespace std;
template <class T>
void out(T A[], int n) {
  for (int i = 0; i < n; i++) cout << A[i] << " ";
  cout << endl;
}
template <class T>
void out(vector<T> A, int n = -1) {
  if (n == -1) n = A.size();
  for (int i = 0; i < n; i++) cout << A[i] << " ";
  cout << endl;
}
const int N = 99999 + 5;
const int M = 9999999;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double EPS = 1e-11;
const int CHILD_NUM = 26;
const int MOD = 1000000007;
int main() {
  long long n, l[N];
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> l[i];
  sort(l, l + n);
  long long ans = 0;
  for (int i = n - 1; i > 0;) {
    long long a, b;
    int j;
    a = b = -1;
    if (l[i] == l[i - 1] || l[i] == l[i - 1] + 1) {
      a = l[i - 1];
      j = i - 2;
      while (j > 0) {
        if (l[j] == l[j - 1] || l[j] == l[j - 1] + 1) {
          b = l[j - 1];
          break;
        }
        --j;
      }
    }
    if (a != -1 && b != -1) {
      ans += a * b;
      i = j - 2;
    } else
      --i;
  }
  cout << ans << endl;
  return 0;
}
