#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 10;
const long long MOD = (long long)(1e9) + (long long)(7);
const long double INF = 1e17;
long long dp[505][505][12];
long long edge[505][505][4];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  map<long long, long long> cnt;
  for (auto &it : v) {
    cin >> it;
    cnt[it]++;
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  if (n < 4)
    cout << 0;
  else {
    for (int i = 0; i < n; i++) {
      if (cnt[v[i]] % 2 == 1) {
        cnt[v[i]]--;
        cnt[v[i] - 1]++;
      }
    }
    long long ans = 0;
    bool form = true;
    long long store = 0;
    for (long long i = 0; i < n; i++) {
      long long l = v[i];
      while (cnt[l] >= 2) {
        if (form == true) {
          form = false;
          store = l;
          cnt[l] -= 2;
        } else {
          form = true;
          ans += store * l;
          store = 0;
          cnt[l] -= 2;
        }
      }
    }
    cout << ans;
  }
}
