#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int a[N]; bool cmp(int x, int y) { return x > y; } int main() { int n; cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i]; } sort(a + 1, a + n + 1, cmp); long long sum = a[1]; for(int i = 2; i <= n; i++) { for(int j = 1; j < i; j++) { a[i] = sqrt(a[i]); } sum += a[i]; } cout << sum; return 0; }