#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
bool ispoweroftwo(long long n) { return n & (!(n & (n - 1))); }
long long mod = 1000000007;
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, -1, 0, 1};
bool test = 0;
const long long inf = 1e18;
const long long N = 2e5 + 5;
long long n;
void solve(long long tc = 0) {
  cin >> n;
  map<long long, long long> m;
  set<long long> st;
  for (long long i = 1, x; i <= n; ++i) {
    cin >> x;
    m[x]++;
    st.insert(x);
  }
  while (!st.empty()) {
    auto p = *st.rbegin();
    st.erase(p);
    if (m[p] & 1) {
      m[p]--;
      if (st.find(p - 1) != st.end()) m[p - 1]++;
    }
  }
  vector<long long> v;
  for (auto it : m) {
    for (long long i = 0; i < it.second / 2; ++i) v.emplace_back(it.first);
  }
  long long n = (long long)v.size();
  long long c = 0;
  if (n & 1) ++c;
  long long ans = 0;
  for (long long i = c; i < n; i += 2) ans += (v[i] * v[i + 1]);
  cout << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  if (test) cin >> t;
  for (long long i = 1; i <= t; ++i) {
    solve(i);
  }
  return 0;
}
