#include <bits/stdc++.h>
int compare(const void *a, const void *b) {
  return (*(long long int *)a - *(long long int *)b);
}
long long int arr[100001];
int main() {
  long long int i, j, k, l, n, max = 0, x, ans = 1, area = 0, flag = 0,
                               count = 0;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
  }
  qsort(arr, n, sizeof(long long int), compare);
  i = n - 1;
  while (i >= 0) {
    if (arr[i] == arr[i - 1]) {
      ans = ans * arr[i];
      count++;
      i = i - 2;
    } else if (arr[i] - 1 == arr[i - 1]) {
      ans = ans * arr[i - 1];
      count++;
      i = i - 2;
    } else
      i--;
    if (count == 2) {
      area = area + ans;
      count = 0;
      ans = 1;
      flag = 1;
    }
  }
  if (flag == 0)
    printf("0");
  else
    printf("%lld", area);
  return 0;
}
