N = int(input()) C = list(map(int,input().split())) s = sum(C) ans = 0 for c in C: if c <= s*0.1: ans += 1 print(ans*30)