#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  std::ios::sync_with_stdio(false);
  long long int N;
  cin >> N;
  vector<long long int> cs(1000001, 0);
  for (long long int n = 0; n < N; ++n) {
    long long int a;
    cin >> a;
    cs[a]++;
  }
  long long int s1 = 0;
  long long int res = 0;
  for (long long int a = 1000000; 0 <= a; --a) {
    while (cs[a] >= 2) {
      if (s1 == 0)
        s1 = a;
      else {
        res += s1 * a;
        s1 = 0;
      }
      cs[a] -= 2;
    }
    while (0 < a && cs[a] >= 1 && cs[a - 1] >= 1) {
      if (s1 == 0)
        s1 = a - 1;
      else {
        res += s1 * (a - 1);
        s1 = 0;
      }
      cs[a]--;
      cs[a - 1]--;
    }
  }
  cout << res << endl;
  return 0;
}
