#include int main() { int n; scanf("%d", &n); int i; int c[102]; for (i = 0; i < n; i++) scanf("%d", &c[i]); int sum = 0; for (i = 0; i < n; i++) sum += c[i]; int ans = 0; for (i = 0; i < n; i++) if (c[i] * 10 <= sum) ans++; ans *= 30; printf("%d\n", ans); return 0; }