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