#include <bits/stdc++.h>
using namespace std;
long long x,n,i,t;
//chuongtrinhcon
bool ktscp(long long x)
{
int c=sqrt(x);
if (c*c==x) return(true);
else return(false);
}
//chuongtrinhchinh
int main()
{
cin>>n;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (ktscp(x)==true) t+=x;
}
cout<<t;
return 0;
}