#include void main(void) { int candidacyNum = 0; scanf("%d",&candidacyNum); int votesList[candidacyNum]; int total = 0; for(int i = 0 ; i < candidacyNum ; i++){ scanf("%d",&votesList[i]); total += votesList[i]; } total /= 10; int result = 0; for(int i = 0 ; i < candidacyNum ; i++){ if(votesList[i] <= total){ result += 30; } } printf("%d",result); }