#include <bits/stdc++.h>
using namespace std;
const int inf = 0x20202020;
const long long mod = 1000000007;
const double eps = 1e-9;
const double pi = 3.1415926535897932384626;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, 1, 0, -1};
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class X>
void debug(vector<X>& v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
long long l[100009], vst[100009];
vector<long long> V;
int main() {
  int i, j, k, T, cas = 0;
  int n;
  cin >> n;
  for (i = 0; i < n; i++) cin >> l[i];
  sort(l, l + n);
  for (i = n - 2; i >= 0;) {
    if (l[i] + 1 == l[i + 1]) {
      vst[i] = 1;
      vst[i + 1] = 1;
      l[i + 1] -= 1;
      i -= 2;
    } else if (l[i] == l[i + 1]) {
      vst[i] = 1;
      vst[i + 1] = 1;
      i -= 2;
    } else
      i--;
  }
  bool t = 0;
  for (i = n - 1; i >= 0; i--) {
    if (!vst[i]) continue;
    t ^= 1;
    if (t) {
      V.push_back(l[i]);
    }
  }
  long long ans = 0;
  for (i = 0; i < ((int)(V).size()); i += 2) {
    if (i == ((int)(V).size()) - 1) break;
    ans += (V[i] * V[i + 1]);
  }
  cout << ans << endl;
  return 0;
}
