#include <bits/stdc++.h>
using namespace std;
long long a[100010];
int b[100010];
inline long long inp() {
  long long n = 0, sign = 1;
  char c;
  c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') sign = -sign;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    n = (n << 3) + (n << 1) + c - '0';
    c = getchar();
  }
  n = n * sign;
  return n;
}
int main() {
  int n, m, x, l;
  n = inp();
  for (int i = 0; i < n; i++) {
    a[i] = inp();
    b[i] = 1;
  }
  sort(a, a + n);
  for (int i = n - 2; i >= 0; i--) {
    if (b[i + 1] == 1 && a[i + 1] <= a[i] + 1) b[i]++;
  }
  long long ans = 0;
  int f = 0;
  int idx;
  for (int i = n - 1; i >= 0; i--) {
    if (b[i] == 2) {
      if (f == 0) {
        f = 1;
        idx = i;
      } else if (f == 1) {
        {
          f = 0;
          ans += (a[i] * a[idx]);
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
