#include <bits/stdc++.h>
using namespace std;
long long int arr[1000001];
int main() {
  long long int n, i, j, k, a, b, c, x, y, z;
  scanf("%lld", &n);
  for (i = 0; i < n; ++i) {
    scanf("%lld", &arr[i]);
  }
  sort(arr, arr + n);
  a = b = -1;
  long long int ans = 0;
  i = n - 1;
  while (i > 0) {
    if (arr[i] - arr[i - 1] <= 1) {
      if (a == -1)
        a = arr[i - 1];
      else
        ans += (a * arr[i - 1]), a = -1;
      i -= 2;
    } else
      --i;
  }
  printf("%lld\n", ans);
  return 0;
}
