#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (INT_MAX/3) #define PI (2*acos(0.0)) #define EPS (1e-8) typedef long long ll; typedef unsigned long long ull; int main(){ ios_base::sync_with_stdio(0); int n, sum = 0; cin >> n; vector c(n); for(int i = 0; i < n; i++) { cin >> c[i]; sum += c[i];} sum /= 10; int ans = 0; for(int i = 0; i < c.size(); i++){ if(c[i] <= sum) ans += 30; } cout << ans << endl; return 0; }