# coding:utf-8 N = int(input()) C = list(map(int, input().split())) sum_c = sum(C) ans = 0 for i in range(N): if C[i] < sum_c/N: ans += 30 print(ans)