#include <bits/stdc++.h>
using namespace std;
int p[200000];
int main() {
  int n, i, j;
  long long S = 0, left, top;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &p[i]);
  }
  sort(&p[0], &p[n]);
  left = top = 0;
  for (i = n - 2; i >= 0; --i) {
    if (p[i + 1] - p[i] < 2) {
      if (left == 0) {
        left = p[i];
      } else {
        top = p[i];
      }
      --i;
    }
    if (left > 0 && top > 0) {
      S += left * top;
      left = top = 0;
    }
  }
  printf("%lld\n", S);
  return 0;
}
