#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; ll n; cin >> n; ll ans = 0; ll c[n], c_sum = 0; for (ll i = 0; i < n; ++i) { cin >> c[i]; c_sum += c[i]; } for (ll i = 0; i < n; ++i) { if (c[i] * 10 <= c_sum) ans++; } cout << ans * 30 << endl; return 0; }