#include<bits/stdc++.h>
using namespace std;
#define int long long 
signed main(){
	cin.tie(0);
	cout.tie(0);
	int a,b[100009],ans=0;
	cin>>a;
	for(int i=1;i<=a;i++){
		cin>>b[i];
	}
	for(int i=1;i<a;i++){
		for(int j=i+1;j<=a;j++){
			if(b[i]<b[j]){
				swap(b[i],b[j]);
			}
		}
	}
	for(int i=1;i<=a;i++){
		ans+=b[i];
		for(int j=i+1;j<=a;j++){
			b[j]=sqrt(b[j]);
		}
	}
	cout<<ans;
}