#include<bits/stdc++.h>
using namespace std ;

bool pai ( int a , int b )
{
	return a > b ;
}

int main ( )
{
	int n ;
	cin >> n ;
	
	int a[n+1] ;
	for ( int i = 1 ; i <= n ; i ++ )
	{
		cin >> a[i] ;
	}
	
	int cnt = 0 ;
	
	sort ( a + 1 , a + 1 + n , pai ) ;
	
	for ( int i = 1 ; i <= n ; i ++ )
	{
		for ( int j = 1 ; j < i ; j ++ )
		{
			a[i] = sqrt ( a[i] ) ;		
		}	
		
		cnt += a[i] ;
	}
	
	cout << cnt ;
	return 0 ;
}