#include using namespace std; int main() { int n; cin >> n; vector c(n); int votes = 0; for (int i = 0; i < n; ++i) { cin >> c[i]; votes += c[i]; } int ans = 0; for (int i = 0; i < n; ++i) { if (10 * c[i] <= votes) ans += 30; } cout << ans << endl; return 0; }