#include using namespace std; #define ll long long #define endl "\n" int main() { int n; cin >> n; int sum = 0; vector c(n); for (int i = 0; i < n; ++i) { int x; cin >> x; sum += x; c[i] = x; } int ave = sum / 10; int cnt = 0; for (int i = 0; i < n; ++i) { if (c[i] <= ave) cnt++; } cout << 30 * cnt << endl; return 0; }