#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { int N; cin >> N; vector C(N); long long s = 0; int ans = 0; for ( int i = 0; i < N; i++ ) { cin >> C[i]; s += C[i]; } for ( int i = 0; i < N; i++ ) { if ( C[i]*10 <= s ) { ans += 30; } } cout << ans << endl; return 0; }