#include<bits/stdc++.h>
using namespace std;
long long a[100100];
int main(){
	int n,m,s=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	reverse(a+1,a+1+n);
	for(int i=1;i<=n;i++){
		s+=a[i];
		for(int j=i+1;j<=n;j++){
			int c=(int)sqrt(a[j]);
			a[j]=c;
		}
	}
	cout<<s;
	return 0;
}