#include using namespace std; int C[100]; int main() { int N; cin >> N; int sum = 0; for (int i = 0; i < N; ++i) { cin >> C[i]; sum += C[i]; } int cnt = 0; for (int i = 0; i < N; ++i) { if (sum / 10.0 >= C[i]) cnt++; } cout << cnt * 30 << endl; }