#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long l[100005];
  long long ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%I64d", &l[i]);
  if (n < 4) {
    printf("%d\n", 0);
    return 0;
  }
  sort(l, l + n);
  for (int i = n - 1; i >= 3; --i) {
    if (l[i] - l[i - 1] > 1) continue;
    for (int j = i - 2; j >= 1; --j) {
      if (l[j] - l[j - 1] > 1) continue;
      ans += l[i - 1] * l[j - 1];
      i = j - 1;
      break;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
