#include <bits/stdc++.h> #include <cmath> #include <string> using namespace std; int hc[1000000001]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>hc[i]; } sort(hc,hc+n); int ans=0; for(int i=n;i>=n;i--){ ans+=hc[i]; for(int j=i;j>=1;j--){ hc[j]=(int)sqrt(hc[j]); } } cout<<ans; return 0; }