#include <bits/stdc++.h>
using namespace std;
int arr[100000];
int A[100000];
int N = 0;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (int i = n - 1; i > 0; i--) {
    if (arr[i] == arr[i - 1]) {
      A[N++] = arr[i];
      i--;
    } else if (arr[i] == arr[i - 1] + 1) {
      A[N++] = arr[i] - 1;
      i--;
    }
  }
  long long ans = 0;
  sort(A, A + N);
  for (int i = N - 1; i >= 0; i -= 2) {
    ans += A[i] * 1LL * A[i - 1];
  }
  cout << ans << endl;
}
