#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int i = n - 1, j = n - 2;
  int flag = 0;
  long long int ans = 0, area = 0;
  while (j >= 0) {
    if (a[i] == a[j] or a[j] == a[i] - 1) {
      if (flag == 0) {
        area = a[j];
        flag = 1;
      } else {
        area = 1ll * area * a[j];
        ans += area;
        flag = 0;
      }
      i -= 2;
      j -= 2;
    } else {
      i--;
      j--;
    }
  }
  cout << ans << endl;
}
