#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
long long int l[maxn], n, x, s, j;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    l[x]++;
  }
  for (int i = 1e6; i >= 2; i--) {
    if (l[i] % 2 == 1 && l[i - 1] != 0) {
      l[i]--;
      l[i - 1]++;
    } else if (l[i] % 2 == 1 && l[i - 1] == 0)
      l[i]--;
  }
  for (int i = 1e6; i >= 2; i--) {
    if (l[i] >= 4) {
      s += (l[i] / 4) * i * i;
      l[i] %= 4;
    }
    if (l[i] >= 2) {
      j = i - 1;
      while (j > 1 && l[j] < 2) j--;
      if (j == 1) continue;
      s += i * j;
      l[i] = 0;
      l[j] -= 2;
      j = i + 2;
    }
  }
  cout << s;
  return 0;
}
