N = int(raw_input()) C = map(int, raw_input().split()) S = sum(C) ans = 0 for c in C: if 1.0 * c / S <= 0.1: ans += 30 print ans