#include #define A 30 int main() { int n, *c, sum = 0; long ans = 0; std::cin >> n; c = new int[n]; for (int i = 0; i < n; i++) { std::cin >> c[i]; sum += c[i]; } sum /= 10; for (int i = 0; i < n; i++) { if (c[i] <= sum) { ans += A; } } std::cout << ans << std::endl; delete c; return 0; }