#include <bits/stdc++.h>
using namespace std;
long long int n, A[100005], m, cev;
int main() {
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &A[i]);
  }
  sort(A + 1, A + n + 1);
  for (int i = n - 1; i >= 1; i--) {
    if (A[i + 1] - A[i] < 2) {
      if (m) {
        cev += m * A[i];
        m = 0;
      } else {
        m = A[i];
      }
      i--;
    }
  }
  printf("%lld", cev);
  return 0;
}
