#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
int n, l[MAX_N + 1];
bool isUsed[MAX_N + 1];
long long ans = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> l[i];
  }
  sort(l + 1, l + n + 1, greater<int>());
  int k = 1;
  for (int i = 2; i <= n; i++) {
    if (l[i] < l[i - 1]) {
      if (k % 2 != 0) {
        l[i - 1]--;
      }
      k = 1;
    }
    if (l[i] == l[i - 1]) {
      k++;
    }
  }
  for (int i = 1; i <= n; i++) {
    isUsed[i] = false;
  }
  int l1 = 0, l2 = 0;
  for (int i = 1; i < n; i++) {
    if (l[i] == l[i + 1]) {
      if (l1 == 0) {
        l1 = l[i];
      } else {
        l2 = l[i];
      }
      i++;
    }
    if (l1 != 0 && l2 != 0) {
      ans += (long long)(l1) * (long long)(l2);
      l1 = 0;
      l2 = 0;
    }
  }
  cout << ans << '\n';
  return 0;
}
