#include <bits/stdc++.h>
using namespace std;
int n,a[100005];
long long s;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	cin>>n;
	for(int i=1; i<=n; i++) cin>>a[i];
	sort(a+1,a+n+1);
	reverse(a+1,a+n+1);
	for(int i=1; i<=n; i++)
	{
		int g=i-1;
		if(g>0)
		{
			for(int j=1; j<=g; j++) a[i]=(int)sqrt(a[i]);
		}
		s+=a[i];
	}
	cout<<s;
	return 0;
}