#include <bits/stdc++.h>
using namespace std;
const int MX = 120000;
int N;
long long A[MX], B[MX], bc;
int main() {
  scanf("%d", &N);
  for (int i = (1); i <= (N); i++) scanf("%lld", A + i);
  sort(A + 1, A + 1 + N);
  long long a = 0, s = 0;
  for (int i = (N); i >= (1); i--) {
    if (a && a - A[i] <= 1)
      B[++bc] = A[i], a = 0;
    else
      a = A[i];
  }
  for (int i = 1; i < bc; i += 2) s += B[i] * B[i + 1];
  printf("%lld\n", s);
  return 0;
}
