#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define REP(i, n) for(int i = 0; i < n; i++)

int main() {
    int n;
    cin >> n;
    int c[n];

    ll votes = 0;
    REP(i, n) {
        cin >> c[i];
        votes += c[i];
    }

    int ans = 0;
    REP(i, n) {
        if (10 * c[i] <= votes) ans += 30;
    }

    cout << ans << endl;
    return 0;
}