#include <bits/stdc++.h>
using namespace std;
int64_t input() {
  int64_t n = 0, m = 1;
  char c = getchar();
  while (!((c >= '0' && c <= '9') || c == '-')) c = getchar();
  if (c == '-') c = getchar(), m = -1;
  while (c >= '0' && c <= '9') n = n * 10 + c - '0', c = getchar();
  return n * m;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  int64_t n = input();
  vector<int64_t> v(n);
  for (int64_t i = 0; i < n; ++i) v[i] = input();
  sort(v.rbegin(), v.rend());
  vector<int64_t> d;
  for (int64_t i = 0; i < n - 1; ++i) {
    if (v[i] == v[i + 1] || v[i] - 1 == v[i + 1]) {
      d.push_back(v[i + 1]);
      ++i;
    }
  }
  int64_t ans = 0;
  for (int64_t i = 0; i < d.size() - (d.size() % 2); i += 2) {
    ans += d[i] * d[i + 1];
  }
  cout << ans;
}
