#include <bits/stdc++.h>
using namespace std;
int s[100100];
long long p[50050];
int main() {
  for (int n, t; scanf("%d", &n) != EOF;) {
    memset(s, 0, sizeof(s));
    for (int i = 0; i < n; i++) scanf("%d", &s[i]);
    sort(s, s + n);
    int cnt = 0;
    long long ans = 0;
    for (int i = n - 1; i > 0; i--) {
      if (s[i] == s[i - 1] || s[i] == s[i - 1] + 1) p[cnt++] = s[i - 1], i--;
    }
    for (int i = 0; i < cnt; i += 2) ans += p[i] * p[i + 1];
    printf("%I64d\n", ans);
  }
  return 0;
}
