#include int main(void) { int hyou[100]; int n = fgetc(stdin); int i, border; int total = 0; int answer = 0; for(i = 0; i < n; i++){ hyou[i] = fgetc(stdin); total += hyou[i]; } border = total / 10; for(i = 0; i < n; i++){ if(hyou[i] <= border){ answer++; } } printf("%d\n", answer * 30); return 0; }