#include <bits/stdc++.h>
using namespace std;
main(){
    priority_queue <long long> q;
    long long n,m;
    cin>>n;
    int i=0;
    long long max;
    max = 0;
    while(i!=n){
        scanf("%lld",&m);
        if(max<m)max=m;
        q.push(m);
        i++;
    }
    int p[2];
    int count = 0;
    while(count!=2&&!q.empty()){
        int a = q.top();
        q.pop();
        int b = q.top();q.pop();
        if(a==b){
            p[count] = a;
            count++;
        }

    }
    if(count!=2)printf("0\nNo rectangle can be formed.");
    else {
        long long area = p[0] * p[1];
        printf("%lld",area);
    }
}
