#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000005;
vector<int> v;
int cnt[MAX];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    cnt[val]++;
  }
  for (int j = MAX - 1; j > 0; j--)
    if (cnt[j] & 1) {
      cnt[j]--;
      if (cnt[j - 1]) cnt[j - 1]++;
    }
  for (int i = 0; i < MAX; i++)
    for (int j = 0; j < cnt[i]; j++) v.push_back(i);
  reverse(v.begin(), v.end());
  long long ans = 0;
  for (int i = 0; i + 2 < v.size(); i += 4) ans += 1LL * v[i] * v[i + 2];
  cout << ans << endl;
  return 0;
}
