#include <bits/stdc++.h>
using namespace std;
long long int a[100005];
int main() {
  long long int res = 0, i, k = 0;
  long long int n, x = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (i = n - 1; i > 0; --i) {
    if (((a[i] == a[i - 1]) || (a[i] == a[i - 1] + 1))) {
      if (x) {
        res += x * a[i - 1];
        x = 0;
      } else {
        x = a[i - 1];
      }
      i--;
    }
  }
  cout << res;
}
