#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll c[1000003],k,x,ma;
int main()
{
ll n,i;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>x;
k=sqrt(x);
ma=max(ma,k);
if(k*k==x) c[k]=1;
}
for(i=0;i<=ma+1;i++)
if(c[i]==0)
{
cout<<i*i;
break;
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBsbCBsb25nIGxvbmcKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKbGwgY1sxMDAwMDAzXSxrLHgsbWE7CmludCBtYWluKCkKewogICAgbGwgbixpOwogICAgY2luPj5uOwogICAgZm9yKGk9MTtpPD1uO2krKykKICAgIHsKICAgICAgICBjaW4+Png7CiAgICAgICAgaz1zcXJ0KHgpOwogICAgICAgIG1hPW1heChtYSxrKTsKICAgICAgICBpZihrKms9PXgpIGNba109MTsKICAgIH0KICAgIGZvcihpPTA7aTw9bWErMTtpKyspCiAgICBpZihjW2ldPT0wKQogICAgewogICAgICAgIGNvdXQ8PGkqaTsKICAgICAgICBicmVhazsKICAgIH0KfQo=