#include <bits/stdc++.h>
using namespace std;
int a[100023];
int cnt[1000023];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  vector<long long> ans;
  for (int i = n - 2; i >= 0; i--) {
    if (a[i] == a[i + 1] || a[i] == a[i + 1] - 1) {
      ans.push_back(a[i]);
      i--;
    }
  }
  long long sum = 0;
  for (int i = 1; i < ans.size(); i += 2) sum += ans[i] * ans[i - 1];
  cout << sum << "\n";
  return 0;
}
