#include <bits/stdc++.h>
using namespace std;
double rd() {
  double ret = 0.0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '.') c = getchar();
  while (c >= '0' && c <= '9') {
    ret = 10 * ret + c - 48;
    c = getchar();
  }
  if (c == '.') {
    c = getchar();
    long long ten = 10;
    while (c >= '0' && c <= '9') {
      ret += (double)(c - 48) / (ten * 1.0);
      ten *= 10;
      c = getchar();
    }
  }
  return ret;
}
int ri() {
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  int ret = 0, neg = 1;
  if (c == '-') {
    neg = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ret = 10 * ret + c - 48;
    c = getchar();
  }
  return ret * neg;
}
long long rl() {
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  long long ret = 0, neg = 1;
  if (c == '-') {
    neg = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ret = 10 * ret + c - 48;
    c = getchar();
  }
  return ret * neg;
}
string rs() {
  char c = getchar();
  while (c == '\n' || c == ' ') c = getchar();
  string ret = "";
  while (c != 10 && c != ' ') {
    ret += c;
    c = getchar();
  }
  return ret;
}
char rc() {
  char c = getchar();
  while (c == '\n' || c == ' ') c = getchar();
  return c;
}
int main() {
  long long n = rl(), i, j, ans = 0;
  vector<long long> a;
  for (i = 0; i < n; i++) a.push_back(rl());
  sort(a.begin(), a.end());
  for (i = n - 1; i >= 1; i--) {
    if (a[i] == a[i - 1]) {
      i--;
      continue;
    }
    if (a[i] - 1 == a[i - 1]) {
      a[i--]--;
      continue;
    }
    a[i] = 0;
  }
  sort(a.begin(), a.end());
  for (i = 0; i < n; i++)
    if (a[i] != 0) break;
  for (j = n - 1; j >= i + 3; j -= 4) ans += a[j] * a[j - 2];
  cout << ans;
  return 0;
}
