#include <bits/stdc++.h>
using namespace std;
long long arr[200005];
int main() {
  long long n, first;
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) scanf("%lld", &arr[i]);
  long long count = 0, ans = 0;
  sort(arr + 1, arr + n + 1);
  for (long long i = 0; i < n; i++) {
    if (n - i - 1 >= 0 && ((arr[n - i] - arr[n - i - 1] == 1) ||
                           (arr[n - i] - arr[n - i - 1] == 0))) {
      if (count == 0) {
        first = arr[n - i - 1];
        count = 1;
        i++;
      } else {
        ans = ans + first * arr[n - i - 1];
        count = 0;
        i++;
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
