#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long ans = 0;
  long long i = n - 1;
  while (i > 0) {
    long long x = 0, y = 0;
    for (; i > 0; --i) {
      if (a[i] - a[i - 1] <= 1) {
        x = min(a[i], a[i - 1]);
        i = i - 2;
        break;
      }
    }
    for (; i > 0; --i) {
      if (a[i] - a[i - 1] <= 1) {
        y = min(a[i], a[i - 1]);
        i = i - 2;
        break;
      }
    }
    ans = ans + x * y;
  }
  cout << ans << endl;
  return 0;
}
