/* p3.cpp

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */

//guzixi ak csp-j
//guzixi ak csp-s
//guzixi ak noip
//guzixi ak shenxuan
//guzixi ak noi
//guzixi ak wc
//guzixi ak ctsc
//guzixi ak ioi
//guzixi ak xxywl

//while(1) rp+=1145141919810;

#include <bits/stdc++.h>
//#include <bits\stdc++.h>
using namespace std;
long long n,a[100000],s;
bool cmp(long long x,long long y){
	return x>y;
}
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i]; 
	}
	sort(a,a+n,cmp);
	for(int i=0;i<n;i++){
		for(int j=0;j<i;j++){
			a[i]=sqrt(a[i]);
			if(a[i]==0)break;
		}
		s+=a[i];
	}
	cout<<s;
	return 0;
} 
void mian();
void man();
//guzixi luogu uid = 1124559, welcome
//love ccf, love jiangsu
//ac p3 at 13:47