#include <bits/stdc++.h>
int arr[100001], count[200001], final[200001];
int cmpfunc(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
int main() {
  long long int arr[100002], edge[60000], n, ans, i;
  int x;
  scanf("%I64d", &n);
  for (i = 0; i < n; i++) scanf("%I64d", &arr[i]);
  qsort(arr, n, sizeof(long long int), cmpfunc);
  x = 0;
  for (i = n - 1; i >= 0; i--) {
    if (arr[i] == arr[i - 1] || arr[i] == arr[i - 1] + 1) {
      edge[x] = arr[i - 1];
      x++;
      i--;
    }
  }
  ans = 0;
  for (i = 0; i < x; i += 2) {
    ans = ans + (edge[i] * edge[i + 1]);
  }
  printf("%I64d", ans);
  return 0;
}
