#include #include #define REP(i, a, b) for (int i = (a); i < (b); i++) #define dump(s) cerr << __LINE__ << "\t:" << #s << " = " << (s) << endl \ using namespace std; int main () { int N; cin >> N; vector v(N); int sum = 0; REP (i, 0, N) { cin >> v[i]; sum += v[i]; } int cnt = 0; REP (i, 0, N) { if (sum >= v[i] * 10) { cnt++; } } cout << cnt * 30 << endl; return 0; }