#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long int b = 0, c = 0, t = 0;
  for (long long int i = n - 1; i >= 1; i--) {
    if (a[i] == a[i - 1] || abs(a[i] - a[i - 1]) == 1) {
      c = b;
      b = a[i - 1];
      i--;
      if (c != 0) {
        t += b * c;
        b = 0, c = 0;
      }
    }
  }
  cout << t;
  return 0;
}
