#include int main(void) { int i, N, C[101], sum, money; scanf("%d", &N); for(i = 1;i <= N;i++){ scanf("%d", &C[i]); } sum = 0; for(i = 1;i <= N;i++){ sum += C[i]; } //printf("%d\n", sum); money = 0; for(i = 1;i <= N;i++){ if(C[i] <= sum / 10)money += 30; } printf("%d\n", money); return 0; }