#include <bits/stdc++.h>
using namespace std;
int n, xx;
int counter[1000009];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &xx);
    counter[xx]++;
  }
  int cnt = 0;
  long long x = 0, y = 0, tot = 0;
  for (int i = 1000000; i > 0; i--) {
    if (counter[i] >= 1 && counter[i + 1] > 0) {
      if (!cnt)
        x = i;
      else
        y = i;
      cnt++;
      counter[i]--;
      counter[i + 1]--;
      i++;
    } else if (counter[i] >= 2) {
      if (!cnt)
        x = i;
      else
        y = i;
      cnt++;
      counter[i] -= 2;
      i++;
    }
    if (cnt == 2) {
      tot += x * y;
      cnt = 0;
    }
  }
  printf("%I64d\n", tot);
  return 0;
}
