#include <bits/stdc++.h>
using namespace std;
unsigned long long freq[(int)1e6 + 9];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    freq[t]++;
  }
  for (int i = (int)1e6 + 9 - 1; i > 1; i--) {
    if (freq[i] & 1)
      if (freq[i - 1]) freq[i]--, freq[i - 1]++;
  }
  unsigned long long res = 0, flag = 0;
  for (int i = (int)1e6 + 9 - 1; i > 0; i--) {
    if (freq[i] < 2) continue;
    if (flag) freq[i] -= 2, res += flag * (unsigned long long)i, flag = 0;
    unsigned long long sqs = freq[i] / 4;
    freq[i] %= 4;
    res += (unsigned long long)i * (unsigned long long)i * sqs;
    if (freq[i] > 1) flag = i;
  }
  cout << res << endl;
  return 0;
}
