#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int N = 1e6 + 10;
int n, ans;
int x[N];
bool cmp(int x, int y) {
	return x > y;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> x[i];
	}
	if (n <= 100) {
		int cs = 0;
		sort(x + 1, x + 1 + n, cmp);
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= cs; j++) {
				if (x[i] == 1) break;
				x[i] = int(sqrt(x[i]));
			}
			ans += x[i];
			cs++;
		}	
		cout << ans << '\n';
		return 0;
	}
	return 0;
}